Program: 151631
Project: 151631
Buggy source:
private Node nextNode(){
  skipWhitespace();
  int start=cursor;
  if (cursor >= length) {
    return null;
  }
 else   if (expr[cursor] == ';') {
    ++cursor;
    return new StatementTerminator();
  }
switch (expr[cursor]) {
case '@':
    start++;
  skipToEOS();
String scriptTk=new String(expr,start,cursor - start);
return new ScriptNode(new TokenNode(scriptTk),true);
case '\'':
case '"':
cursor=balancedCapture(expr,cursor,expr[cursor]);
return new TokenNode(new String(expr,start + 1,cursor++ - start - 1));
case '(':
cursor=balancedCapture(expr,cursor,expr[cursor]);
return new FSHParser(new String(expr,++start,cursor++ - start),true).parse();
default :
String tk=captureToken();
if (isReservedWord(tk)) {
boolean block="String_Node_Str".equals(tk) || "String_Node_Str".equals(tk) || "String_Node_Str".equals(tk);
start=cursor;
SkipLoop: while (cursor <= length) {
switch (expr[cursor]) {
case '\'':
case '"':
case '(':
cursor=balancedCapture(expr,cursor,expr[cursor]);
if (block) {
cursor++;
while (cursor != length && Character.isWhitespace(expr[cursor])) cursor++;
StringAppender buf=new StringAppender();
if (cursor != length) {
do {
boolean openBracket=expr[cursor] == '{';
if (openBracket) {
cursor++;
}
buf.append(shellToMVEL(new String(expr,start,cursor - start - (openBracket ? 1 : 0)),true));
if (openBracket) {
buf.append('{');
}
start=cursor;
if (openBracket) {
cursor=balancedCapture(expr,cursor,'{');
}
 else {
while (cursor != length && expr[cursor] != ';') cursor++;
}
int offset=cursor != length && expr[cursor] == '}' ? -1 : 0;
buf.append(shellToMVEL(new String(expr,start,cursor - start).trim(),false));
if (offset == -1) {
buf.append("String_Node_Str");
cursor++;
}
tk+=buf.toString();
buf.reset();
start=cursor;
}
 while (ifThenElseBlockContinues());
return new ScriptNode(new TokenNode(tk),false);
}
}
break;
case ';':
break SkipLoop;
}
cursor++;
}
tk+=new String(expr,start,cursor - start);
}
return tk.startsWith("String_Node_Str") ? new ScriptNode(new TokenNode(tk),false) : new TokenNode(tk);
}
}

Fixed version (ground truth):
private Node nextNode(){
  skipWhitespace();
  int start=cursor;
  if (cursor >= length) {
    return null;
  }
 else   if (expr[cursor] == ';') {
    ++cursor;
    return new StatementTerminator();
  }
switch (expr[cursor]) {
case '@':
    start++;
  skipToEOS();
String scriptTk=new String(expr,start,cursor - start);
return new ScriptNode(new TokenNode(scriptTk),true);
case '\'':
case '"':
cursor=balancedCapture(expr,cursor,expr[cursor]);
return new StringTokenNode(new String(expr,start + 1,cursor++ - start - 1));
case '(':
cursor=balancedCapture(expr,cursor,expr[cursor]);
return new FSHParser(new String(expr,++start,cursor++ - start),true).parse();
default :
String tk=captureToken();
if (isReservedWord(tk)) {
boolean block="String_Node_Str".equals(tk) || "String_Node_Str".equals(tk) || "String_Node_Str".equals(tk);
start=cursor;
SkipLoop: while (cursor <= length) {
switch (expr[cursor]) {
case '\'':
case '"':
case '(':
cursor=balancedCapture(expr,cursor,expr[cursor]);
if (block) {
cursor++;
while (cursor != length && Character.isWhitespace(expr[cursor])) cursor++;
StringAppender buf=new StringAppender();
if (cursor != length) {
do {
boolean openBracket=expr[cursor] == '{';
if (openBracket) {
cursor++;
}
buf.append(shellToMVEL(new String(expr,start,cursor - start - (openBracket ? 1 : 0)),true));
if (openBracket) {
buf.append('{');
}
start=cursor;
if (openBracket) {
cursor=balancedCapture(expr,cursor,'{');
}
 else {
while (cursor != length && expr[cursor] != ';') cursor++;
}
int offset=cursor != length && expr[cursor] == '}' ? -1 : 0;
buf.append(shellToMVEL(new String(expr,start,cursor - start).trim(),false));
if (offset == -1) {
buf.append("String_Node_Str");
cursor++;
}
tk+=buf.toString();
buf.reset();
start=cursor;
}
 while (ifThenElseBlockContinues());
return new ScriptNode(new TokenNode(tk),false);
}
}
break;
case ';':
break SkipLoop;
}
cursor++;
}
tk+=new String(expr,start,cursor - start);
}
return tk.startsWith("String_Node_Str") ? new ScriptNode(new TokenNode(tk),false) : new TokenNode(tk);
}
}