maximumIntegerDigits = groupingSize; groupingSize = 0; if (maximumIntegerDigits > minimumIntegerDigits && maximumIntegerDigits > 0) { minimumIntegerDigits = 1; exponentRound = maximumIntegerDigits; } else exponentRound = 1;
  private final int scanFormat (String pattern, int index,				String patChars, DecimalFormatSymbols syms,				boolean is_positive)  {    int max = pattern.length();    int countSinceGroup = 0;    int zeroCount = 0;    boolean saw_group = false;    //    // Scan integer part.    //    while (index < max)      {	char c = pattern.charAt(index);	if (c == syms.getDigit())	  {	    if (zeroCount > 0)	      throw new IllegalArgumentException ("digit mark following " +						  "zero - index: " + index);	    ++countSinceGroup;	  }	else if (c == syms.getZeroDigit())	  {	    ++zeroCount;	    ++countSinceGroup;	  }	else if (c == syms.getGroupingSeparator())	  {	    countSinceGroup = 0;	    saw_group = true;	  }	else	  break;	++index;      }    // We can only side-effect when parsing the positive format.    if (is_positive)      {	groupingUsed = saw_group;	groupingSize = (byte) countSinceGroup;	minimumIntegerDigits = zeroCount;      }    // Early termination.    if (index == max || pattern.charAt(index) == syms.getGroupingSeparator())      {	if (is_positive)	  decimalSeparatorAlwaysShown = false;	return index;      }    if (pattern.charAt(index) == syms.getDecimalSeparator())      {	++index;	//	// Scan fractional part.	//	int hashCount = 0;	zeroCount = 0;	while (index < max)	  {	    char c = pattern.charAt(index);	    if (c == syms.getZeroDigit())	      {		if (hashCount > 0)		  throw new IllegalArgumentException ("zero mark " +						      "following digit - index: " + index);		++zeroCount;	      }	    else if (c == syms.getDigit())	      {		++hashCount;	      }	    else if (c != syms.getExponential()		     && c != syms.getPatternSeparator()		     && c != syms.getPercent()		     && c != syms.getPerMill()		     && patChars.indexOf(c) != -1)	      throw new IllegalArgumentException ("unexpected special " +						  "character - index: " + index);	    else	      break;	    ++index;	  }	if (is_positive)	  {	    maximumFractionDigits = hashCount + zeroCount;	    minimumFractionDigits = zeroCount;	  }	if (index == max)	  return index;      }    if (pattern.charAt(index) == syms.getExponential())      {	//	// Scan exponential format.	//	zeroCount = 0;	++index;	while (index < max)	  {	    char c = pattern.charAt(index);	    if (c == syms.getZeroDigit())	      ++zeroCount;	    else if (c == syms.getDigit())	      {		if (zeroCount > 0)		  throw new		    IllegalArgumentException ("digit mark following zero " +					      "in exponent - index: " +					      index);	      }	    else if (patChars.indexOf(c) != -1)	      throw new IllegalArgumentException ("unexpected special " +						  "character - index: " +						  index);	    else	      break;	    ++index;	  }	if (is_positive)	  {	    useExponentialNotation = true;	    minExponentDigits = (byte) zeroCount;	  }      }    return index;  }