Program: 84495
Project: 84495
Buggy source:
public static IToken tokenize(String code){
  int len=code.length();
  StringBuilder buf=new StringBuilder(20);
  IToken first=new InferredSemicolon(0,0);
  IToken prev=first;
  int start=0;
  int lineNumber=1;
  char l=0;
  char c=0;
  int type=0;
  int subtype=0;
  boolean addToken=false;
  boolean reparse=true;
  boolean string=false;
  for (int i=0; i < len; ++i, l=c) {
    c=code.charAt(i);
    if (type == 0) {
      start=i;
      if (c == '\n') {
        lineNumber++;
        continue;
      }
      if (c <= ' ') {
        continue;
      }
      if (string && c == ')') {
        type=STRING_2;
        subtype=STRING_PART;
        continue;
      }
      int m=getMode(c,code,i);
      type=m & 0xFFFF;
      subtype=m & 0xFFFF0000;
    }
    typeswitch: switch (type) {
case IDENTIFIER:
switch (subtype) {
case MOD_DOTS:
        if (c == '.') {
          buf.append(c);
          continue;
        }
      addToken=true;
    break typeswitch;
case MOD_LETTER:
  if (c == '_' || c == '$') {
    buf.append(c);
    subtype=MOD_LETTER | MOD_SYMBOL;
    continue;
  }
if (isIdentifierPart(c)) {
  buf.append(c);
  continue;
}
addToken=true;
break typeswitch;
case MOD_SYMBOL:
if (c == '_' || c == '$') {
buf.append(c);
subtype=MOD_LETTER | MOD_SYMBOL;
continue;
}
if (isIdentifierSymbol(c)) {
buf.append(c);
continue;
}
addToken=true;
break typeswitch;
case MOD_LETTER | MOD_SYMBOL:
if (c == '_' || c == '$') {
buf.append(c);
continue;
}
if (isIdentifierPart(c)) {
buf.append(c);
subtype=MOD_LETTER;
continue;
}
if (isIdentifierSymbol(c)) {
buf.append(c);
subtype=MOD_LETTER;
continue;
}
addToken=true;
break typeswitch;
}
break;
case SPECIAL_IDENTIFIER:
switch (c) {
case '\n':
case '\t':
case '\b':
continue;
case '`':
if (buf.length() == 0) {
continue;
}
addToken=true;
reparse=false;
break typeswitch;
default :
buf.append(c);
continue;
}
case SYMBOL:
buf.append(c);
addToken=true;
reparse=false;
break;
case BRACKET:
buf.append(c);
addToken=true;
reparse=false;
break;
case COMMENT:
if (subtype == MOD_LINE) {
if (c == '\n') {
type=0;
lineNumber++;
continue;
}
}
 else if (subtype == MOD_BLOCK) {
if (c == '\n') {
lineNumber++;
}
 else if (l == '*' && c == '/') {
type=0;
continue;
}
}
break;
case INT:
case LONG:
switch (c) {
case '.':
case 'e':
type=FLOAT;
buf.append(c);
continue;
case 'l':
case 'L':
type=LONG;
addToken=true;
reparse=false;
break;
case '_':
continue;
case '-':
if (buf.length() == 0) {
buf.append('-');
continue;
}
addToken=true;
reparse=true;
break;
}
if (subtype == MOD_DEC) {
if (isDigit(c)) {
buf.append(c);
}
 else if (c == 'e' || c == 'E') {
type=FLOAT;
buf.append('e');
}
 else if (c == 'f' || c == 'F') {
type=FLOAT;
addToken=true;
reparse=false;
}
 else if (c == 'd' || c == 'D') {
type=DOUBLE;
addToken=true;
reparse=false;
}
 else {
addToken=true;
}
}
 else if (subtype == MOD_BIN) {
if (c == 'b' || isBinDigit(c)) {
buf.append(c);
}
 else {
addToken=true;
}
}
 else if (subtype == MOD_OCT) {
if (c == 'o' || isOctDigit(c)) {
buf.append(c);
}
 else {
addToken=true;
}
}
 else if (subtype == MOD_HEX) {
if (c == 'x' || isHexDigit(c)) {
buf.append(c);
}
 else {
addToken=true;
}
}
break;
case FLOAT:
case DOUBLE:
if (c == 'x') {
subtype=MOD_HEX;
buf.append(c);
}
 else if (c == 'f' || c == 'F') {
addToken=true;
reparse=false;
}
 else if (c == 'd' || c == 'D') {
type=DOUBLE;
addToken=true;
reparse=false;
}
 else if (isDigit(c) || c == 'e') {
buf.append(c);
}
 else {
addToken=true;
}
break;
case STRING:
if (c == '"' && buf.length() > 0) {
buf.append('"');
addToken=true;
reparse=false;
}
 else if (c == '\\' && appendEscape(buf,code.charAt(i + 1))) {
i++;
continue;
}
 else if (c != '\t') {
buf.append(c);
}
break;
case STRING_2:
if (c == '"' && (buf.length() > 1 || string)) {
if (!string && buf.charAt(0) == '@') {
subtype=STRING_2;
}
 else {
subtype=STRING_END;
}
string=false;
addToken=true;
reparse=false;
break;
}
 else if (c == '\\') {
char c1=code.charAt(i + 1);
if (c1 == '(') {
i+=2;
if (buf.length() == 0 || buf.charAt(0) != '@') {
subtype=STRING_PART;
}
 else {
subtype=STRING_START;
}
addToken=true;
string=true;
break;
}
 else if (appendEscape(buf,c1)) {
i++;
continue;
}
buf.append('\\');
break;
}
 else if (c != '\t') {
buf.append(c);
}
break;
case CHAR:
if (c == '\'' && buf.length() > 0) {
buf.append('\'');
addToken=true;
reparse=false;
}
 else if (c == '\\' && appendEscape(buf,code.charAt(i + 1))) {
i++;
continue;
}
 else if (c != '\t') {
buf.append(c);
}
break;
case GENERIC_CALL:
if (c == '[') {
addToken=true;
reparse=false;
break;
}
continue;
}
if (addToken) {
prev=addToken(prev,buf,type | subtype,lineNumber,start);
addToken=false;
type=0;
if (reparse) {
i--;
}
 else {
reparse=true;
}
}
}
if (buf.length() > 0) {
addToken(prev,buf,type | subtype,lineNumber,start);
}
return first.next();
}

Fixed version (ground truth):
public TokenIterator tokenize(String code){
  int len=code.length();
  StringBuilder buf=new StringBuilder(20);
  IToken first=new InferredSemicolon(0,0);
  IToken prev=first;
  int start=0;
  int lineNumber=1;
  char l=0;
  char c=0;
  int type=0;
  int subtype=0;
  boolean addToken=false;
  boolean reparse=true;
  boolean string=false;
  for (int i=0; i < len; ++i, l=c) {
    c=code.charAt(i);
    if (type == 0) {
      start=i;
      if (c == '\n') {
        lineNumber++;
        continue;
      }
      if (c <= ' ') {
        continue;
      }
      if (string && c == ')') {
        type=STRING_2;
        subtype=STRING_PART;
        continue;
      }
      int m=getMode(c,code,i);
      type=m & 0xFFFF;
      subtype=m & 0xFFFF0000;
    }
    typeswitch: switch (type) {
case IDENTIFIER:
switch (subtype) {
case MOD_DOTS:
        if (c == '.') {
          buf.append(c);
          continue;
        }
      addToken=true;
    break typeswitch;
case MOD_LETTER:
  if (c == '_' || c == '$') {
    buf.append(c);
    subtype=MOD_LETTER | MOD_SYMBOL;
    continue;
  }
if (isIdentifierPart(c)) {
  buf.append(c);
  continue;
}
addToken=true;
break typeswitch;
case MOD_SYMBOL:
if (c == '_' || c == '$') {
buf.append(c);
subtype=MOD_LETTER | MOD_SYMBOL;
continue;
}
if (isIdentifierSymbol(c)) {
buf.append(c);
continue;
}
addToken=true;
break typeswitch;
case MOD_LETTER | MOD_SYMBOL:
if (c == '_' || c == '$') {
buf.append(c);
continue;
}
if (isIdentifierPart(c)) {
buf.append(c);
subtype=MOD_LETTER;
continue;
}
if (isIdentifierSymbol(c)) {
buf.append(c);
subtype=MOD_LETTER;
continue;
}
addToken=true;
break typeswitch;
}
break;
case SPECIAL_IDENTIFIER:
switch (c) {
case '\n':
case '\t':
case '\b':
continue;
case '`':
if (buf.length() == 0) {
continue;
}
addToken=true;
reparse=false;
break typeswitch;
default :
buf.append(c);
continue;
}
case SYMBOL:
buf.append(c);
addToken=true;
reparse=false;
break;
case BRACKET:
buf.append(c);
addToken=true;
reparse=false;
break;
case COMMENT:
if (subtype == MOD_LINE) {
if (c == '\n') {
type=0;
lineNumber++;
continue;
}
}
 else if (subtype == MOD_BLOCK) {
if (c == '\n') {
lineNumber++;
}
 else if (l == '*' && c == '/') {
type=0;
continue;
}
}
break;
case INT:
case LONG:
switch (c) {
case '.':
case 'e':
type=FLOAT;
buf.append(c);
continue;
case 'l':
case 'L':
type=LONG;
addToken=true;
reparse=false;
break;
case '_':
continue;
case '-':
if (buf.length() == 0) {
buf.append('-');
continue;
}
addToken=true;
reparse=true;
break;
}
if (subtype == MOD_DEC) {
if (isDigit(c)) {
buf.append(c);
}
 else if (c == 'e' || c == 'E') {
type=FLOAT;
buf.append('e');
}
 else if (c == 'f' || c == 'F') {
type=FLOAT;
addToken=true;
reparse=false;
}
 else if (c == 'd' || c == 'D') {
type=DOUBLE;
addToken=true;
reparse=false;
}
 else {
addToken=true;
}
}
 else if (subtype == MOD_BIN) {
if (c == 'b' || isBinDigit(c)) {
buf.append(c);
}
 else {
addToken=true;
}
}
 else if (subtype == MOD_OCT) {
if (c == 'o' || isOctDigit(c)) {
buf.append(c);
}
 else {
addToken=true;
}
}
 else if (subtype == MOD_HEX) {
if (c == 'x' || isHexDigit(c)) {
buf.append(c);
}
 else {
addToken=true;
}
}
break;
case FLOAT:
case DOUBLE:
if (c == 'x') {
subtype=MOD_HEX;
buf.append(c);
}
 else if (c == 'f' || c == 'F') {
addToken=true;
reparse=false;
}
 else if (c == 'd' || c == 'D') {
type=DOUBLE;
addToken=true;
reparse=false;
}
 else if (isDigit(c) || c == 'e') {
buf.append(c);
}
 else {
addToken=true;
}
break;
case STRING:
if (c == '"' && buf.length() > 0) {
buf.append('"');
addToken=true;
reparse=false;
}
 else if (c == '\\' && appendEscape(buf,code.charAt(i + 1))) {
i++;
continue;
}
 else if (c != '\t') {
buf.append(c);
}
break;
case STRING_2:
if (c == '"' && (buf.length() > 1 || string)) {
if (!string && buf.charAt(0) == '@') {
subtype=STRING_2;
}
 else {
subtype=STRING_END;
}
string=false;
addToken=true;
reparse=false;
break;
}
 else if (c == '\\') {
char c1=code.charAt(i + 1);
if (c1 == '(') {
i+=2;
if (buf.length() == 0 || buf.charAt(0) != '@') {
subtype=STRING_PART;
}
 else {
subtype=STRING_START;
}
addToken=true;
string=true;
break;
}
 else if (appendEscape(buf,c1)) {
i++;
continue;
}
buf.append('\\');
break;
}
 else if (c != '\t') {
buf.append(c);
}
break;
case CHAR:
if (c == '\'' && buf.length() > 0) {
buf.append('\'');
addToken=true;
reparse=false;
}
 else if (c == '\\' && appendEscape(buf,code.charAt(i + 1))) {
i++;
continue;
}
 else if (c != '\t') {
buf.append(c);
}
break;
case GENERIC_CALL:
if (c == '[') {
addToken=true;
reparse=false;
break;
}
continue;
}
if (addToken) {
prev=addToken(prev,buf,type | subtype,lineNumber,start);
addToken=false;
type=0;
if (reparse) {
i--;
}
 else {
reparse=true;
}
}
}
if (buf.length() > 0) {
addToken(prev,buf,type | subtype,lineNumber,start);
}
return new TokenIterator(first.next());
}