Program: 61554
Project: 61554
Buggy source:
private GraphTargetItem expressionPrimary(boolean allowEmpty,boolean inFunction,boolean inMethod,boolean allowRemainder,List<VariableActionItem> variables) throws IOException, ActionParseException {
  if (debugMode) {
    System.out.println("String_Node_Str");
  }
  boolean allowMemberOrCall=false;
  GraphTargetItem ret=null;
  ParsedSymbol s=lex();
switch (s.type) {
case NEGATE:
    versionRequired(s,5);
  ret=expression(inFunction,inMethod,false,variables);
ret=new BitXorActionItem(null,ret,new DirectValueActionItem(4.294967295E9));
break;
case MINUS:
s=lex();
if (s.isType(SymbolType.DOUBLE)) {
ret=new DirectValueActionItem(null,0,-(double)(Double)s.value,new ArrayList<String>());
}
 else if (s.isType(SymbolType.INTEGER)) {
ret=new DirectValueActionItem(null,0,-(long)(Long)s.value,new ArrayList<String>());
}
 else {
lexer.pushback(s);
GraphTargetItem num=expression(inFunction,inMethod,true,variables);
if ((num instanceof DirectValueActionItem) && (((DirectValueActionItem)num).value instanceof Long)) {
((DirectValueActionItem)num).value=-(Long)((DirectValueActionItem)num).value;
ret=num;
}
 else if ((num instanceof DirectValueActionItem) && (((DirectValueActionItem)num).value instanceof Double)) {
Double d=(Double)((DirectValueActionItem)num).value;
if (d.isInfinite()) {
((DirectValueActionItem)num).value=Double.NEGATIVE_INFINITY;
}
 else {
((DirectValueActionItem)num).value=-d;
}
ret=(num);
}
 else if ((num instanceof DirectValueActionItem) && (((DirectValueActionItem)num).value instanceof Float)) {
((DirectValueActionItem)num).value=-(Float)((DirectValueActionItem)num).value;
ret=(num);
}
 else {
;
ret=(new SubtractActionItem(null,new DirectValueActionItem(null,0,(Long)0L,new ArrayList<String>()),num));
}
}
break;
case TYPEOF:
ret=new TypeOfActionItem(null,expression(inFunction,inMethod,false,variables));
allowMemberOrCall=true;
break;
case TRUE:
ret=new DirectValueActionItem(null,0,Boolean.TRUE,new ArrayList<String>());
break;
case NULL:
ret=new DirectValueActionItem(null,0,new Null(),new ArrayList<String>());
break;
case UNDEFINED:
ret=new DirectValueActionItem(null,0,new Undefined(),new ArrayList<String>());
break;
case FALSE:
ret=new DirectValueActionItem(null,0,Boolean.FALSE,new ArrayList<String>());
break;
case CURLY_OPEN:
s=lex();
List<GraphTargetItem> objectNames=new ArrayList<>();
List<GraphTargetItem> objectValues=new ArrayList<>();
while (s.type != SymbolType.CURLY_CLOSE) {
if (s.type != SymbolType.COMMA) {
lexer.pushback(s);
}
s=lex();
expected(s,lexer.yyline(),SymbolType.IDENTIFIER);
objectNames.add(0,pushConst((String)s.value));
expectedType(SymbolType.COLON);
objectValues.add(0,expression(inFunction,inMethod,true,variables));
s=lex();
if (!s.isType(SymbolType.COMMA,SymbolType.CURLY_CLOSE)) {
expected(s,lexer.yyline(),SymbolType.COMMA,SymbolType.CURLY_CLOSE);
}
}
ret=new InitObjectActionItem(null,objectNames,objectValues);
allowMemberOrCall=true;
break;
case BRACKET_OPEN:
lexer.pushback(s);
List<GraphTargetItem> inBrackets=new ArrayList<>();
int arrCnt=brackets(inBrackets,inFunction,inMethod,variables);
ret=new InitArrayActionItem(null,inBrackets);
allowMemberOrCall=true;
break;
case FUNCTION:
s=lex();
String fname="String_Node_Str";
if (s.isType(SymbolType.IDENTIFIER,SymbolGroup.GLOBALFUNC)) {
fname=s.value.toString();
}
 else {
lexer.pushback(s);
}
ret=function(true,fname,false,variables);
allowMemberOrCall=true;
break;
case STRING:
ret=pushConst(s.value.toString());
allowMemberOrCall=true;
break;
case NEWLINE:
ret=new DirectValueActionItem(null,0,"String_Node_Str",new ArrayList<String>());
allowMemberOrCall=true;
break;
case NAN:
ret=new DirectValueActionItem(null,0,Double.NaN,new ArrayList<String>());
break;
case INFINITY:
ret=new DirectValueActionItem(null,0,Double.POSITIVE_INFINITY,new ArrayList<String>());
break;
case INTEGER:
case DOUBLE:
ret=new DirectValueActionItem(null,0,s.value,new ArrayList<String>());
break;
case DELETE:
GraphTargetItem varDel=expression(inFunction,inMethod,false,variables);
if (varDel instanceof GetMemberActionItem) {
GetMemberActionItem gm=(GetMemberActionItem)varDel;
ret=new DeleteActionItem(null,gm.object,gm.memberName);
}
 else {
throw new ActionParseException("String_Node_Str",lexer.yyline());
}
break;
case INCREMENT:
case DECREMENT:
GraphTargetItem prevar=expressionPrimary(false,inFunction,inMethod,false,variables);
if (s.type == SymbolType.INCREMENT) {
ret=new PreIncrementActionItem(null,prevar);
}
if (s.type == SymbolType.DECREMENT) {
ret=new PreDecrementActionItem(null,prevar);
}
break;
case NOT:
ret=new NotItem(null,expression(inFunction,inMethod,false,variables));
break;
case PARENT_OPEN:
ret=new ParenthesisItem(null,expression(inFunction,inMethod,true,variables));
expectedType(SymbolType.PARENT_CLOSE);
allowMemberOrCall=true;
break;
case NEW:
GraphTargetItem newvar=expressionPrimary(false,inFunction,inMethod,false,variables);
if (newvar instanceof CallMethodActionItem) {
CallMethodActionItem ca=(CallMethodActionItem)newvar;
ret=new NewMethodActionItem(null,ca.scriptObject,ca.methodName,ca.arguments);
}
 else if (newvar instanceof CallFunctionActionItem) {
CallFunctionActionItem cf=(CallFunctionActionItem)newvar;
ret=new NewObjectActionItem(null,cf.functionName,cf.arguments);
}
 else {
throw new ActionParseException("String_Node_Str",lexer.yyline());
}
break;
case EVAL:
expectedType(SymbolType.PARENT_OPEN);
GraphTargetItem evar=new EvalActionItem(null,expression(inFunction,inMethod,true,variables));
expectedType(SymbolType.PARENT_CLOSE);
ret=evar;
allowMemberOrCall=true;
break;
case IDENTIFIER:
case THIS:
case SUPER:
if (s.value.equals("String_Node_Str")) {
ret=new NotItem(null,expression(inFunction,inMethod,false,variables));
}
 else {
ret=new VariableActionItem(s.value.toString(),null,false);
variables.add((VariableActionItem)ret);
allowMemberOrCall=true;
}
break;
default :
GraphTargetItem excmd=expressionCommands(s,inFunction,inMethod,-1,variables);
if (excmd != null) {
ret=excmd;
allowMemberOrCall=true;
break;
}
lexer.pushback(s);
}
if (allowMemberOrCall && ret != null) {
ret=memberOrCall(ret,inFunction,inMethod,variables);
}
if (debugMode) {
System.out.println("String_Node_Str");
}
return ret;
}

Fixed version (ground truth):
private GraphTargetItem expressionPrimary(boolean allowEmpty,boolean inFunction,boolean inMethod,boolean allowRemainder,List<VariableActionItem> variables) throws IOException, ActionParseException {
  if (debugMode) {
    System.out.println("String_Node_Str");
  }
  boolean allowMemberOrCall=false;
  GraphTargetItem ret=null;
  ParsedSymbol s=lex();
switch (s.type) {
case NEGATE:
    versionRequired(s,5);
  ret=expressionPrimary(false,inFunction,inMethod,false,variables);
ret=new BitXorActionItem(null,ret,new DirectValueActionItem(4.294967295E9));
break;
case MINUS:
s=lex();
if (s.isType(SymbolType.DOUBLE)) {
ret=new DirectValueActionItem(null,0,-(double)(Double)s.value,new ArrayList<String>());
}
 else if (s.isType(SymbolType.INTEGER)) {
ret=new DirectValueActionItem(null,0,-(long)(Long)s.value,new ArrayList<String>());
}
 else {
lexer.pushback(s);
GraphTargetItem num=expressionPrimary(false,inFunction,inMethod,true,variables);
if ((num instanceof DirectValueActionItem) && (((DirectValueActionItem)num).value instanceof Long)) {
((DirectValueActionItem)num).value=-(Long)((DirectValueActionItem)num).value;
ret=num;
}
 else if ((num instanceof DirectValueActionItem) && (((DirectValueActionItem)num).value instanceof Double)) {
Double d=(Double)((DirectValueActionItem)num).value;
if (d.isInfinite()) {
((DirectValueActionItem)num).value=Double.NEGATIVE_INFINITY;
}
 else {
((DirectValueActionItem)num).value=-d;
}
ret=(num);
}
 else if ((num instanceof DirectValueActionItem) && (((DirectValueActionItem)num).value instanceof Float)) {
((DirectValueActionItem)num).value=-(Float)((DirectValueActionItem)num).value;
ret=(num);
}
 else {
;
ret=(new SubtractActionItem(null,new DirectValueActionItem(null,0,(Long)0L,new ArrayList<String>()),num));
}
}
break;
case TYPEOF:
ret=new TypeOfActionItem(null,expressionPrimary(false,inFunction,inMethod,false,variables));
allowMemberOrCall=true;
break;
case TRUE:
ret=new DirectValueActionItem(null,0,Boolean.TRUE,new ArrayList<String>());
break;
case NULL:
ret=new DirectValueActionItem(null,0,new Null(),new ArrayList<String>());
break;
case UNDEFINED:
ret=new DirectValueActionItem(null,0,new Undefined(),new ArrayList<String>());
break;
case FALSE:
ret=new DirectValueActionItem(null,0,Boolean.FALSE,new ArrayList<String>());
break;
case CURLY_OPEN:
s=lex();
List<GraphTargetItem> objectNames=new ArrayList<>();
List<GraphTargetItem> objectValues=new ArrayList<>();
while (s.type != SymbolType.CURLY_CLOSE) {
if (s.type != SymbolType.COMMA) {
lexer.pushback(s);
}
s=lex();
expected(s,lexer.yyline(),SymbolType.IDENTIFIER);
objectNames.add(0,pushConst((String)s.value));
expectedType(SymbolType.COLON);
objectValues.add(0,expression(inFunction,inMethod,true,variables));
s=lex();
if (!s.isType(SymbolType.COMMA,SymbolType.CURLY_CLOSE)) {
expected(s,lexer.yyline(),SymbolType.COMMA,SymbolType.CURLY_CLOSE);
}
}
ret=new InitObjectActionItem(null,objectNames,objectValues);
allowMemberOrCall=true;
break;
case BRACKET_OPEN:
lexer.pushback(s);
List<GraphTargetItem> inBrackets=new ArrayList<>();
int arrCnt=brackets(inBrackets,inFunction,inMethod,variables);
ret=new InitArrayActionItem(null,inBrackets);
allowMemberOrCall=true;
break;
case FUNCTION:
s=lex();
String fname="String_Node_Str";
if (s.isType(SymbolType.IDENTIFIER,SymbolGroup.GLOBALFUNC)) {
fname=s.value.toString();
}
 else {
lexer.pushback(s);
}
ret=function(true,fname,false,variables);
allowMemberOrCall=true;
break;
case STRING:
ret=pushConst(s.value.toString());
allowMemberOrCall=true;
break;
case NEWLINE:
ret=new DirectValueActionItem(null,0,"String_Node_Str",new ArrayList<String>());
allowMemberOrCall=true;
break;
case NAN:
ret=new DirectValueActionItem(null,0,Double.NaN,new ArrayList<String>());
break;
case INFINITY:
ret=new DirectValueActionItem(null,0,Double.POSITIVE_INFINITY,new ArrayList<String>());
break;
case INTEGER:
case DOUBLE:
ret=new DirectValueActionItem(null,0,s.value,new ArrayList<String>());
break;
case DELETE:
GraphTargetItem varDel=expressionPrimary(false,inFunction,inMethod,false,variables);
if (varDel instanceof GetMemberActionItem) {
GetMemberActionItem gm=(GetMemberActionItem)varDel;
ret=new DeleteActionItem(null,gm.object,gm.memberName);
}
 else {
throw new ActionParseException("String_Node_Str",lexer.yyline());
}
break;
case INCREMENT:
case DECREMENT:
GraphTargetItem prevar=expressionPrimary(false,inFunction,inMethod,false,variables);
if (s.type == SymbolType.INCREMENT) {
ret=new PreIncrementActionItem(null,prevar);
}
if (s.type == SymbolType.DECREMENT) {
ret=new PreDecrementActionItem(null,prevar);
}
break;
case NOT:
ret=new NotItem(null,expressionPrimary(false,inFunction,inMethod,false,variables));
break;
case PARENT_OPEN:
ret=new ParenthesisItem(null,expression(inFunction,inMethod,true,variables));
expectedType(SymbolType.PARENT_CLOSE);
allowMemberOrCall=true;
break;
case NEW:
GraphTargetItem newvar=expressionPrimary(false,inFunction,inMethod,false,variables);
if (newvar instanceof CallMethodActionItem) {
CallMethodActionItem ca=(CallMethodActionItem)newvar;
ret=new NewMethodActionItem(null,ca.scriptObject,ca.methodName,ca.arguments);
}
 else if (newvar instanceof CallFunctionActionItem) {
CallFunctionActionItem cf=(CallFunctionActionItem)newvar;
ret=new NewObjectActionItem(null,cf.functionName,cf.arguments);
}
 else {
throw new ActionParseException("String_Node_Str",lexer.yyline());
}
break;
case EVAL:
expectedType(SymbolType.PARENT_OPEN);
GraphTargetItem evar=new EvalActionItem(null,expression(inFunction,inMethod,true,variables));
expectedType(SymbolType.PARENT_CLOSE);
ret=evar;
allowMemberOrCall=true;
break;
case IDENTIFIER:
case THIS:
case SUPER:
if (s.value.equals("String_Node_Str")) {
ret=new NotItem(null,expressionPrimary(false,inFunction,inMethod,false,variables));
}
 else {
ret=new VariableActionItem(s.value.toString(),null,false);
variables.add((VariableActionItem)ret);
allowMemberOrCall=true;
}
break;
default :
GraphTargetItem excmd=expressionCommands(s,inFunction,inMethod,-1,variables);
if (excmd != null) {
ret=excmd;
allowMemberOrCall=true;
break;
}
lexer.pushback(s);
}
if (allowMemberOrCall && ret != null) {
ret=memberOrCall(ret,inFunction,inMethod,variables);
}
if (debugMode) {
System.out.println("String_Node_Str");
}
return ret;
}