Program: 61821
Project: 61821
Buggy source:
private GraphTargetItem expressionRemainder(GraphTargetItem expr,HashMap<String,Integer> registerVars,boolean inFunction,boolean inMethod,boolean allowRemainder,List<VariableActionItem> variables) throws IOException, ParseException {
  GraphTargetItem ret=null;
  ParsedSymbol s=lex();
switch (s.type) {
case DOT:
    lexer.pushback(s);
  ret=memberOrCall(expr,registerVars,inFunction,inMethod,variables);
break;
case TERNAR:
GraphTargetItem terOnTrue=expression(registerVars,inFunction,inMethod,false,variables);
expectedType(SymbolType.COLON);
GraphTargetItem terOnFalse=expression(registerVars,inFunction,inMethod,false,variables);
ret=new TernarOpItem(null,expr,terOnTrue,terOnFalse);
break;
case SHIFT_LEFT:
ret=new LShiftActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case SHIFT_RIGHT:
ret=new RShiftActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case BITAND:
ret=new BitAndActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case BITOR:
ret=new BitOrActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case DIVIDE:
ret=new DivideActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case MODULO:
ret=new ModuloActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case EQUALS:
ret=new EqActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables),true);
break;
case STRICT_EQUALS:
ret=new StrictEqActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case NOT_EQUAL:
ret=new NeqActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables),true);
break;
case STRICT_NOT_EQUAL:
ret=new StrictNeqActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case LOWER_THAN:
ret=new LtActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables),true);
break;
case LOWER_EQUAL:
ret=new LeActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case GREATER_THAN:
ret=new GtActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case GREATER_EQUAL:
ret=new GeActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables),true);
break;
case AND:
ret=new AndItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case OR:
ret=new OrItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case MINUS:
ret=new SubtractActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case MULTIPLY:
ret=new MultiplyActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case PLUS:
ret=new AddActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables),true);
break;
case XOR:
ret=new BitXorActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case AS:
break;
case INSTANCEOF:
ret=new InstanceOfActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case IS:
break;
default :
lexer.pushback(s);
if (expr instanceof ParenthesisItem) {
if (isType(((ParenthesisItem)expr).value)) {
GraphTargetItem expr2=expression(false,registerVars,inFunction,inMethod,true,variables);
if (expr2 != null) {
ret=new CastOpActionItem(null,((ParenthesisItem)expr).value,expr2);
}
}
}
}
ret=fixPrecedence(ret);
return ret;
}

Fixed version (ground truth):
private GraphTargetItem expressionRemainder(GraphTargetItem expr,HashMap<String,Integer> registerVars,boolean inFunction,boolean inMethod,boolean allowRemainder,List<VariableActionItem> variables) throws IOException, ParseException {
  GraphTargetItem ret=null;
  ParsedSymbol s=lex();
switch (s.type) {
case DOT:
    lexer.pushback(s);
  ret=memberOrCall(expr,registerVars,inFunction,inMethod,variables);
break;
case TERNAR:
GraphTargetItem terOnTrue=expression(registerVars,inFunction,inMethod,true,variables);
expectedType(SymbolType.COLON);
GraphTargetItem terOnFalse=expression(registerVars,inFunction,inMethod,true,variables);
ret=new TernarOpItem(null,expr,terOnTrue,terOnFalse);
break;
case SHIFT_LEFT:
ret=new LShiftActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case SHIFT_RIGHT:
ret=new RShiftActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case BITAND:
ret=new BitAndActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case BITOR:
ret=new BitOrActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case DIVIDE:
ret=new DivideActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case MODULO:
ret=new ModuloActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case EQUALS:
ret=new EqActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables),true);
break;
case STRICT_EQUALS:
ret=new StrictEqActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case NOT_EQUAL:
ret=new NeqActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables),true);
break;
case STRICT_NOT_EQUAL:
ret=new StrictNeqActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case LOWER_THAN:
ret=new LtActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables),true);
break;
case LOWER_EQUAL:
ret=new LeActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case GREATER_THAN:
ret=new GtActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case GREATER_EQUAL:
ret=new GeActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables),true);
break;
case AND:
ret=new AndItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case OR:
ret=new OrItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case MINUS:
ret=new SubtractActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case MULTIPLY:
ret=new MultiplyActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case PLUS:
ret=new AddActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables),true);
break;
case XOR:
ret=new BitXorActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case AS:
break;
case INSTANCEOF:
ret=new InstanceOfActionItem(null,expr,expression(registerVars,inFunction,inMethod,false,variables));
break;
case IS:
break;
default :
lexer.pushback(s);
if (expr instanceof ParenthesisItem) {
if (isType(((ParenthesisItem)expr).value)) {
GraphTargetItem expr2=expression(false,registerVars,inFunction,inMethod,true,variables);
if (expr2 != null) {
ret=new CastOpActionItem(null,((ParenthesisItem)expr).value,expr2);
}
}
}
}
ret=fixPrecedence(ret);
return ret;
}