Program: 84340
Project: 84340
Buggy source:
public TokenIterator tokenize(String code){
  int len=code.length();
  StringBuilder buf=new StringBuilder(20);
  IToken first=new StartToken();
  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;
        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_LETTER:
        if (c == '_' || c == '$') {
          buf.append(c);
          subtype=MOD_LETTER | MOD_SYMBOL;
          continue;
        }
      if (LexerUtil.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 (LexerUtil.isIdentifierSymbol(c)) {
buf.append(c);
continue;
}
addToken=true;
break typeswitch;
case MOD_LETTER | MOD_SYMBOL:
if (c == '_' || c == '$') {
buf.append(c);
continue;
}
if (LexerUtil.isIdentifierPart(c)) {
buf.append(c);
subtype=MOD_LETTER;
continue;
}
if (LexerUtil.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 'l':
case 'L':
type=LONG;
addToken=true;
reparse=false;
break;
case '_':
continue;
}
if (subtype == MOD_DEC) {
if (LexerUtil.isDigit(c)) {
buf.append(c);
}
 else if (c == '.') {
if (!LexerUtil.isDigit(code.charAt(i + 1))) {
addToken=true;
reparse=true;
break typeswitch;
}
type=DOUBLE;
buf.append('.');
}
 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' || LexerUtil.isBinDigit(c)) {
buf.append(c);
}
 else {
addToken=true;
}
}
 else if (subtype == MOD_OCT) {
if (c == 'o' || LexerUtil.isOctDigit(c)) {
buf.append(c);
}
 else {
addToken=true;
}
}
 else if (subtype == MOD_HEX) {
if (c == 'x' || LexerUtil.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') {
type=FLOAT;
addToken=true;
reparse=false;
}
 else if (c == 'd' || c == 'D') {
type=DOUBLE;
addToken=true;
reparse=false;
}
 else if (LexerUtil.isDigit(c) || c == 'e') {
buf.append(c);
}
 else if (c == '-' && code.charAt(i - 1) == 'e') {
buf.append('-');
}
 else {
addToken=true;
}
break;
case STRING:
if (c == '"' && (buf.length() > 1 || string)) {
if (!string && buf.charAt(0) == '"') {
subtype=STRING;
}
 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 SINGLE_QUOTED_STRING:
if (c == '\'' && buf.length() > 0) {
addToken=true;
reparse=false;
}
 else if (c == '\\' && appendEscape(buf,code.charAt(i + 1))) {
i++;
continue;
}
 else if (c != '\t') {
buf.append(c);
}
break;
case LITERAL_STRING:
if (c == '"' && buf.length() > 0) {
addToken=true;
reparse=false;
}
 else if (c != '@' || buf.length() > 0) {
buf.append(c);
}
break;
}
if (addToken) {
prev=this.addToken(prev,buf,type | subtype,lineNumber,start);
addToken=false;
type=0;
if (reparse) {
i--;
}
 else {
reparse=true;
}
}
}
if (buf.length() > 0) {
prev=this.addToken(prev,buf,type | subtype,lineNumber,start);
}
EndToken end=new EndToken(len,lineNumber);
prev.setNext(end);
end.setPrev(prev);
first.next().setPrev(first);
return new TokenIterator(first.next());
}

Fixed version (ground truth):
public TokenIterator tokenize(String code){
  int len=code.length();
  StringBuilder buf=new StringBuilder(20);
  IToken first=new StartToken();
  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;
        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_LETTER:
        if (c == '_' || c == '$') {
          buf.append(c);
          subtype=MOD_LETTER | MOD_SYMBOL;
          continue;
        }
      if (LexerUtil.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 (LexerUtil.isIdentifierSymbol(c)) {
buf.append(c);
continue;
}
addToken=true;
break typeswitch;
case MOD_LETTER | MOD_SYMBOL:
if (c == '_' || c == '$') {
buf.append(c);
continue;
}
if (LexerUtil.isIdentifierPart(c)) {
buf.append(c);
subtype=MOD_LETTER;
continue;
}
if (LexerUtil.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 'l':
case 'L':
type=LONG;
addToken=true;
reparse=false;
break;
case '_':
continue;
}
if (subtype == MOD_DEC) {
if (LexerUtil.isDigit(c)) {
buf.append(c);
}
 else if (c == '.') {
if (!LexerUtil.isDigit(code.charAt(i + 1))) {
addToken=true;
reparse=true;
break typeswitch;
}
type=DOUBLE;
buf.append('.');
}
 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' || LexerUtil.isBinDigit(c)) {
buf.append(c);
}
 else {
addToken=true;
}
}
 else if (subtype == MOD_OCT) {
if (c == 'o' || LexerUtil.isOctDigit(c)) {
buf.append(c);
}
 else {
addToken=true;
}
}
 else if (subtype == MOD_HEX) {
if (c == 'x' || LexerUtil.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') {
type=FLOAT;
addToken=true;
reparse=false;
}
 else if (c == 'd' || c == 'D') {
type=DOUBLE;
addToken=true;
reparse=false;
}
 else if (LexerUtil.isDigit(c) || c == 'e') {
buf.append(c);
}
 else if (c == '-' && code.charAt(i - 1) == 'e') {
buf.append('-');
}
 else {
addToken=true;
}
break;
case STRING:
if (c == '"' && (buf.length() > 0 || string)) {
if (!string && buf.charAt(0) == '"') {
subtype=STRING;
}
 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 SINGLE_QUOTED_STRING:
if (c == '\'' && buf.length() > 0) {
addToken=true;
reparse=false;
}
 else if (c == '\\' && appendEscape(buf,code.charAt(i + 1))) {
i++;
continue;
}
 else if (c != '\t') {
buf.append(c);
}
break;
case LITERAL_STRING:
if (c == '"' && buf.length() > 0) {
addToken=true;
reparse=false;
}
 else if (c != '@' || buf.length() > 0) {
buf.append(c);
}
break;
}
if (addToken) {
prev=this.addToken(prev,buf,type | subtype,lineNumber,start);
addToken=false;
type=0;
if (reparse) {
i--;
}
 else {
reparse=true;
}
}
}
if (buf.length() > 0) {
prev=this.addToken(prev,buf,type | subtype,lineNumber,start);
}
EndToken end=new EndToken(len,lineNumber);
prev.setNext(end);
end.setPrev(prev);
first.next().setPrev(first);
return new TokenIterator(first.next());
}