Program: 3595
Project: 3595
Buggy source:
/** 
 * Parses and returns Integer, Long or Double type. <pre> Number ← Minus? IntegralPart FractionalPart? ExponentPart? Minus ← "-" IntegralPart ← "0" / [1-9] [0-9] FractionalPart ← "." [0-9]+ ExponentPart ← ( "e" / "E" ) ( "+" / "-" )? [0-9]+ </pre>
 */
private Object parseNumber() throws ParseException {
  final int startIdx=getPosition();
  if (peek() == '-') {
    next();
  }
  final int integralStartIdx=getPosition();
  for (; hasMore(); next()) {
    final char c=peek();
    if (c < '0' || c > '9') {
      break;
    }
  }
  final int integralEndIdx=getPosition();
  final int numIntegralDigits=integralEndIdx - integralStartIdx;
  if (numIntegralDigits == 0) {
    throw new ParseException(this,"String_Node_Str");
  }
  final boolean hasFractionalPart=peek() == '.';
  if (hasFractionalPart) {
    next();
    for (; hasMore(); next()) {
      final char c=peek();
      if (c < '0' || c > '9') {
        break;
      }
    }
    if (getPosition() - (integralEndIdx + 1) == 0) {
      throw new ParseException(this,"String_Node_Str");
    }
  }
  final boolean hasExponentPart=peek() == '.';
  if (hasExponentPart) {
    next();
    final char sign=peek();
    if (sign == '-' || sign == '+') {
      next();
    }
    final int exponentStart=getPosition();
    for (; hasMore(); next()) {
      final char c=peek();
      if (c < '0' || c > '9') {
        break;
      }
    }
    if (getPosition() - exponentStart == 0) {
      throw new ParseException(this,"String_Node_Str");
    }
  }
  final int endIdx=getPosition();
  final String numberStr=getSubstring(startIdx,endIdx).toString();
  if (hasFractionalPart || hasExponentPart) {
    return Double.valueOf(numberStr);
  }
 else   if (numIntegralDigits < 9) {
    return Integer.valueOf(numberStr);
  }
 else   if (numIntegralDigits == 9) {
    final long longVal=Long.valueOf(numberStr);
    if (longVal >= Integer.MIN_VALUE && longVal < Integer.MAX_VALUE) {
      return Integer.valueOf((int)longVal);
    }
 else {
      return Long.valueOf(longVal);
    }
  }
 else {
    return Long.valueOf(numberStr);
  }
}

Fixed version (ground truth):
/** 
 * Parses and returns Integer, Long or Double type. <pre> Number ← Minus? IntegralPart FractionalPart? ExponentPart? Minus ← "-" IntegralPart ← "0" / [1-9] [0-9] FractionalPart ← "." [0-9]+ ExponentPart ← ( "e" / "E" ) ( "+" / "-" )? [0-9]+ </pre>
 */
private Object parseNumber() throws ParseException {
  final int startIdx=getPosition();
  if (peek() == '-') {
    next();
  }
  final int integralStartIdx=getPosition();
  for (; hasMore(); next()) {
    final char c=peek();
    if (c < '0' || c > '9') {
      break;
    }
  }
  final int integralEndIdx=getPosition();
  final int numIntegralDigits=integralEndIdx - integralStartIdx;
  if (numIntegralDigits == 0) {
    throw new ParseException(this,"String_Node_Str");
  }
  final boolean hasFractionalPart=peek() == '.';
  if (hasFractionalPart) {
    next();
    for (; hasMore(); next()) {
      final char c=peek();
      if (c < '0' || c > '9') {
        break;
      }
    }
    if (getPosition() - (integralEndIdx + 1) == 0) {
      throw new ParseException(this,"String_Node_Str");
    }
  }
  final boolean hasExponentPart=peek() == '.';
  if (hasExponentPart) {
    next();
    final char sign=peek();
    if (sign == '-' || sign == '+') {
      next();
    }
    final int exponentStart=getPosition();
    for (; hasMore(); next()) {
      final char c=peek();
      if (c < '0' || c > '9') {
        break;
      }
    }
    if (getPosition() - exponentStart == 0) {
      throw new ParseException(this,"String_Node_Str");
    }
  }
  final int endIdx=getPosition();
  final String numberStr=getSubstring(startIdx,endIdx).toString();
  if (hasFractionalPart || hasExponentPart) {
    return Double.valueOf(numberStr);
  }
 else   if (numIntegralDigits < 9) {
    return Integer.valueOf(numberStr);
  }
 else   if (numIntegralDigits == 9) {
    final long longVal=Long.parseLong(numberStr);
    if (longVal >= Integer.MIN_VALUE && longVal < Integer.MAX_VALUE) {
      return Integer.valueOf((int)longVal);
    }
 else {
      return Long.valueOf(longVal);
    }
  }
 else {
    return Long.valueOf(numberStr);
  }
}