Program: 83059
Project: 83059
Buggy source:
@Override public void parse(IParserManager pm,IToken token){
  if (this.mode == END) {
    if (this.value != null) {
      this.field.setValue(this.value);
    }
    pm.popParser(true);
    return;
  }
  int type=token.type();
switch (type) {
case Symbols.SEMICOLON:
case Symbols.COLON:
case Symbols.COMMA:
case Tokens.STRING_PART:
case Tokens.STRING_END:
    if (this.value != null) {
      this.field.setValue(this.value);
    }
  pm.popParser(true);
return;
}
switch (this.mode) {
case VALUE:
switch (type) {
case Tokens.STRING:
this.value=new StringValue(token.raw(),token.stringValue());
this.mode=ACCESS;
return;
case Tokens.STRING_START:
{
FormatStringExpression ssv=new FormatStringExpression(token);
this.value=ssv;
this.mode=ACCESS;
pm.pushParser(new FormatStringParser(ssv),true);
return;
}
case Tokens.CHAR:
this.value=new CharValue(token.raw(),token.charValue());
this.mode=ACCESS;
return;
case Tokens.INT:
this.value=new IntValue(token.raw(),token.intValue());
this.mode=ACCESS;
return;
case Tokens.LONG:
this.value=new LongValue(token.raw(),token.longValue());
this.mode=ACCESS;
return;
case Tokens.FLOAT:
this.value=new FloatValue(token.raw(),token.floatValue());
this.mode=ACCESS;
return;
case Tokens.DOUBLE:
this.value=new DoubleValue(token.raw(),token.doubleValue());
this.mode=ACCESS;
return;
case Symbols.ELLIPSIS:
this.value=new WildcardValue(token.raw());
this.mode=ACCESS;
return;
case Symbols.WILDCARD:
return;
case Symbols.OPEN_PARENTHESIS:
IToken next=token.next();
if (next.type() == Symbols.CLOSE_PARENTHESIS) {
if (next.next().type() == Symbols.ARROW_OPERATOR) {
LambdaExpression le=new LambdaExpression(next.next().raw());
this.value=le;
pm.skip(2);
pm.pushParser(pm.newExpressionParser(le));
this.mode=ACCESS;
return;
}
this.value=new VoidValue(token.to(token.next()));
pm.skip();
this.mode=END;
return;
}
pm.pushParser(new LambdaOrTupleParser(this),true);
this.mode=ACCESS;
return;
case Symbols.OPEN_SQUARE_BRACKET:
this.mode=ACCESS;
pm.pushParser(new ArrayLiteralParser(this),true);
return;
case Symbols.OPEN_CURLY_BRACKET:
this.mode=END;
pm.pushParser(new StatementListParser(this),true);
return;
case Symbols.AT:
if (token.next().type() == Symbols.OPEN_CURLY_BRACKET) {
Bytecode bc=new Bytecode(token);
pm.skip();
pm.pushParser(new BytecodeParser(bc));
this.mode=BYTECODE_END;
this.value=bc;
return;
}
Annotation a=new Annotation();
pm.pushParser(new AnnotationParser(a));
this.value=new AnnotationValue(a);
this.mode=0;
return;
case Symbols.ARROW_OPERATOR:
LambdaExpression le=new LambdaExpression(token.raw());
this.value=le;
this.mode=ACCESS;
pm.pushParser(pm.newExpressionParser(le));
return;
}
if ((type & Tokens.IDENTIFIER) != 0) {
Name name=token.nameValue();
this.parseAccess(pm,token,type,name,pm.getOperator(name));
return;
}
if (this.parseKeyword(pm,token,type)) {
return;
}
this.mode=ACCESS;
break;
case PATTERN_IF:
this.mode=PATTERN_END;
if (type == Keywords.IF) {
pm.pushParser(pm.newExpressionParser(v -> ((ICase)this.value).setCondition(v)));
return;
}
case PATTERN_END:
if (type == Symbols.COLON || type == Symbols.ARROW_OPERATOR) {
this.mode=END;
if (token.next().type() != Keywords.CASE) {
pm.pushParser(pm.newExpressionParser(v -> ((ICase)this.value).setAction(v)));
}
return;
}
pm.report(token,"String_Node_Str");
return;
case ANONYMOUS_CLASS_END:
this.value.expandPosition(token);
this.mode=ACCESS_2;
if (type != Symbols.CLOSE_CURLY_BRACKET) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
return;
case PARAMETERS_END:
this.mode=ACCESS;
this.value.expandPosition(token);
if (type == Symbols.CLOSE_PARENTHESIS) {
return;
}
pm.reparse();
pm.report(token,"String_Node_Str");
return;
case SUBSCRIPT_END:
this.mode=ACCESS;
this.value.expandPosition(token);
if (type == Symbols.CLOSE_SQUARE_BRACKET) {
return;
}
pm.reparse();
pm.report(token,"String_Node_Str");
return;
case CONSTRUCTOR:
{
ConstructorCall cc=(ConstructorCall)this.value;
if (type == Symbols.OPEN_CURLY_BRACKET) {
this.parseBody(pm,cc.toClassConstructor());
return;
}
this.mode=PARAMETERS;
pm.reparse();
return;
}
case PARAMETERS:
{
ICall icall=(ICall)this.value;
if (type == Symbols.OPEN_PARENTHESIS) {
IArguments arguments=this.parseArguments(pm,token.next());
icall.setArguments(arguments);
this.mode=CONSTRUCTOR_END;
return;
}
if (ParserUtil.isExpressionTerminator(type)) {
this.mode=ACCESS;
pm.reparse();
return;
}
SingleArgument sa=new SingleArgument();
icall.setArguments(sa);
ExpressionParser ep=(ExpressionParser)pm.newExpressionParser(sa);
ep.operator=Operators.DEFAULT;
pm.pushParser(ep,true);
this.mode=END;
return;
}
case CONSTRUCTOR_END:
this.mode=ACCESS;
if (token.next().type() == Symbols.OPEN_CURLY_BRACKET) {
pm.skip();
this.parseBody(pm,((ConstructorCall)this.value).toClassConstructor());
return;
}
this.value.expandPosition(token);
if (type == Symbols.CLOSE_PARENTHESIS) {
return;
}
pm.reparse();
pm.report(token,"String_Node_Str");
return;
case BYTECODE_END:
this.field.setValue(this.value);
pm.popParser();
this.value.expandPosition(token);
if (type == Symbols.CLOSE_CURLY_BRACKET) {
return;
}
pm.reparse();
pm.report(token,"String_Node_Str");
return;
case TYPE_ARGUMENTS_END:
MethodCall mc=(MethodCall)this.value;
IToken next=token.next();
if (next.type() == Symbols.OPEN_PARENTHESIS) {
pm.skip();
mc.setArguments(this.parseArguments(pm,next.next()));
}
this.mode=ACCESS;
if (type == Symbols.CLOSE_SQUARE_BRACKET) {
return;
}
pm.report(token,"String_Node_Str");
return;
}
if (ParserUtil.isCloseBracket(type)) {
if (this.value != null) {
this.field.setValue(this.value);
}
pm.popParser(true);
return;
}
if (this.mode == ACCESS) {
if (type == Symbols.DOT) {
this.mode=ACCESS_2;
this.explicitDot=true;
return;
}
this.explicitDot=false;
switch (type) {
case Keywords.ELSE:
this.field.setValue(this.value);
pm.popParser(true);
return;
case Symbols.EQUALS:
this.parseAssignment(pm,token);
return;
case Keywords.AS:
CastOperator co=new CastOperator(token.raw(),this.value);
pm.pushParser(pm.newTypeParser(co));
this.value=co;
return;
case Keywords.IS:
InstanceOfOperator io=new InstanceOfOperator(token.raw(),this.value);
pm.pushParser(pm.newTypeParser(io));
this.value=io;
return;
case Keywords.MATCH:
MatchExpression me=new MatchExpression(token.raw(),this.value);
pm.pushParser(new MatchExpressionParser(me));
this.value=me;
return;
case Symbols.OPEN_SQUARE_BRACKET:
SubscriptGetter getter=new SubscriptGetter(token,this.value);
this.value=getter;
this.mode=SUBSCRIPT_END;
pm.pushParser(new ExpressionListParser(getter.getArguments()));
return;
case Symbols.OPEN_PARENTHESIS:
ApplyMethodCall amc=new ApplyMethodCall(this.value.getPosition(),this.value,this.parseArguments(pm,token.next()));
this.value=amc;
this.mode=PARAMETERS_END;
return;
}
this.mode=ACCESS_2;
}
if (this.mode == ACCESS_2) {
if (ParserUtil.isIdentifier(type)) {
this.parseIdentifierAccess(pm,token,type);
return;
}
pm.report(token,"String_Node_Str" + token);
return;
}
pm.report(token,"String_Node_Str" + token);
return;
}

Fixed version (ground truth):
@Override public void parse(IParserManager pm,IToken token){
  if (this.mode == END) {
    if (this.value != null) {
      this.field.setValue(this.value);
    }
    pm.popParser(true);
    return;
  }
  int type=token.type();
switch (type) {
case Symbols.SEMICOLON:
case Symbols.COLON:
case Symbols.COMMA:
case Tokens.STRING_PART:
case Tokens.STRING_END:
    if (this.value != null) {
      this.field.setValue(this.value);
    }
  pm.popParser(true);
return;
}
switch (this.mode) {
case VALUE:
switch (type) {
case Tokens.STRING:
this.value=new StringValue(token.raw(),token.stringValue());
this.mode=ACCESS;
return;
case Tokens.STRING_START:
{
FormatStringExpression ssv=new FormatStringExpression(token);
this.value=ssv;
this.mode=ACCESS;
pm.pushParser(new FormatStringParser(ssv),true);
return;
}
case Tokens.CHAR:
this.value=new CharValue(token.raw(),token.charValue());
this.mode=ACCESS;
return;
case Tokens.INT:
this.value=new IntValue(token.raw(),token.intValue());
this.mode=ACCESS;
return;
case Tokens.LONG:
this.value=new LongValue(token.raw(),token.longValue());
this.mode=ACCESS;
return;
case Tokens.FLOAT:
this.value=new FloatValue(token.raw(),token.floatValue());
this.mode=ACCESS;
return;
case Tokens.DOUBLE:
this.value=new DoubleValue(token.raw(),token.doubleValue());
this.mode=ACCESS;
return;
case Symbols.ELLIPSIS:
this.value=new WildcardValue(token.raw());
this.mode=ACCESS;
return;
case Symbols.WILDCARD:
return;
case Symbols.OPEN_PARENTHESIS:
IToken next=token.next();
if (next.type() == Symbols.CLOSE_PARENTHESIS) {
if (next.next().type() == Symbols.ARROW_OPERATOR) {
LambdaExpression le=new LambdaExpression(next.next().raw());
this.value=le;
pm.skip(2);
pm.pushParser(pm.newExpressionParser(le));
this.mode=ACCESS;
return;
}
this.value=new VoidValue(token.to(token.next()));
pm.skip();
this.mode=END;
return;
}
pm.pushParser(new LambdaOrTupleParser(this),true);
this.mode=ACCESS;
return;
case Symbols.OPEN_SQUARE_BRACKET:
this.mode=ACCESS;
pm.pushParser(new ArrayLiteralParser(this),true);
return;
case Symbols.OPEN_CURLY_BRACKET:
this.mode=END;
pm.pushParser(new StatementListParser(this),true);
return;
case Symbols.AT:
if (token.next().type() == Symbols.OPEN_CURLY_BRACKET) {
Bytecode bc=new Bytecode(token);
pm.skip();
pm.pushParser(new BytecodeParser(bc));
this.mode=BYTECODE_END;
this.value=bc;
return;
}
Annotation a=new Annotation();
pm.pushParser(new AnnotationParser(a));
this.value=new AnnotationValue(a);
this.mode=0;
return;
case Symbols.ARROW_OPERATOR:
LambdaExpression le=new LambdaExpression(token.raw());
this.value=le;
this.mode=ACCESS;
pm.pushParser(pm.newExpressionParser(le));
return;
}
if ((type & Tokens.IDENTIFIER) != 0) {
Name name=token.nameValue();
this.parseAccess(pm,token,type,name,pm.getOperator(name));
return;
}
if (this.parseKeyword(pm,token,type)) {
return;
}
this.mode=ACCESS;
break;
case PATTERN_IF:
this.mode=PATTERN_END;
if (type == Keywords.IF) {
pm.pushParser(pm.newExpressionParser(v -> ((ICase)this.value).setCondition(v)));
return;
}
case PATTERN_END:
if (type == Symbols.COLON || type == Symbols.ARROW_OPERATOR) {
this.mode=END;
if (token.next().type() != Keywords.CASE) {
pm.pushParser(pm.newExpressionParser(v -> ((ICase)this.value).setAction(v)));
}
return;
}
pm.report(token,"String_Node_Str");
return;
case ANONYMOUS_CLASS_END:
this.value.expandPosition(token);
this.mode=ACCESS_2;
if (type != Symbols.CLOSE_CURLY_BRACKET) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
return;
case PARAMETERS_END:
this.mode=ACCESS;
this.value.expandPosition(token);
if (type == Symbols.CLOSE_PARENTHESIS) {
return;
}
pm.reparse();
pm.report(token,"String_Node_Str");
return;
case SUBSCRIPT_END:
this.mode=ACCESS;
this.value.expandPosition(token);
if (type == Symbols.CLOSE_SQUARE_BRACKET) {
return;
}
pm.reparse();
pm.report(token,"String_Node_Str");
return;
case CONSTRUCTOR:
{
ConstructorCall cc=(ConstructorCall)this.value;
if (type == Symbols.OPEN_CURLY_BRACKET) {
this.parseBody(pm,cc.toClassConstructor());
return;
}
this.mode=PARAMETERS;
pm.reparse();
return;
}
case PARAMETERS:
{
ICall icall=(ICall)this.value;
if (type == Symbols.OPEN_PARENTHESIS) {
IArguments arguments=this.parseArguments(pm,token.next());
icall.setArguments(arguments);
this.mode=CONSTRUCTOR_END;
return;
}
if (ParserUtil.isExpressionTerminator(type)) {
this.mode=ACCESS;
pm.reparse();
return;
}
SingleArgument sa=new SingleArgument();
icall.setArguments(sa);
ExpressionParser ep=(ExpressionParser)pm.newExpressionParser(sa);
ep.operator=Operators.DEFAULT;
pm.pushParser(ep,true);
this.mode=END;
return;
}
case CONSTRUCTOR_END:
this.mode=ACCESS;
if (token.next().type() == Symbols.OPEN_CURLY_BRACKET) {
pm.skip();
this.parseBody(pm,((ConstructorCall)this.value).toClassConstructor());
return;
}
this.value.expandPosition(token);
if (type == Symbols.CLOSE_PARENTHESIS) {
return;
}
pm.reparse();
pm.report(token,"String_Node_Str");
return;
case BYTECODE_END:
this.field.setValue(this.value);
pm.popParser();
this.value.expandPosition(token);
if (type == Symbols.CLOSE_CURLY_BRACKET) {
return;
}
pm.reparse();
pm.report(token,"String_Node_Str");
return;
case TYPE_ARGUMENTS_END:
MethodCall mc=(MethodCall)this.value;
IToken next=token.next();
if (next.type() == Symbols.OPEN_PARENTHESIS) {
pm.skip();
mc.setArguments(this.parseArguments(pm,next.next()));
}
this.mode=ACCESS;
if (type != Symbols.CLOSE_SQUARE_BRACKET) {
pm.report(token,"String_Node_Str");
}
return;
case PARAMETERIZED_THIS_END:
this.mode=ACCESS;
if (type != Symbols.CLOSE_SQUARE_BRACKET) {
pm.report(token,"String_Node_Str");
}
return;
case PARAMETERIZED_SUPER_END:
this.mode=ACCESS;
if (type != Symbols.CLOSE_SQUARE_BRACKET) {
pm.report(token,"String_Node_Str");
}
return;
}
if (ParserUtil.isCloseBracket(type)) {
if (this.value != null) {
this.field.setValue(this.value);
}
pm.popParser(true);
return;
}
if (this.mode == ACCESS) {
if (type == Symbols.DOT) {
this.mode=ACCESS_2;
this.explicitDot=true;
return;
}
this.explicitDot=false;
switch (type) {
case Keywords.ELSE:
this.field.setValue(this.value);
pm.popParser(true);
return;
case Symbols.EQUALS:
this.parseAssignment(pm,token);
return;
case Keywords.AS:
CastOperator co=new CastOperator(token.raw(),this.value);
pm.pushParser(pm.newTypeParser(co));
this.value=co;
return;
case Keywords.IS:
InstanceOfOperator io=new InstanceOfOperator(token.raw(),this.value);
pm.pushParser(pm.newTypeParser(io));
this.value=io;
return;
case Keywords.MATCH:
MatchExpression me=new MatchExpression(token.raw(),this.value);
pm.pushParser(new MatchExpressionParser(me));
this.value=me;
return;
case Symbols.OPEN_SQUARE_BRACKET:
SubscriptGetter getter=new SubscriptGetter(token,this.value);
this.value=getter;
this.mode=SUBSCRIPT_END;
pm.pushParser(new ExpressionListParser(getter.getArguments()));
return;
case Symbols.OPEN_PARENTHESIS:
ApplyMethodCall amc=new ApplyMethodCall(this.value.getPosition(),this.value,this.parseArguments(pm,token.next()));
this.value=amc;
this.mode=PARAMETERS_END;
return;
}
this.mode=ACCESS_2;
}
if (this.mode == ACCESS_2) {
if (ParserUtil.isIdentifier(type)) {
this.parseIdentifierAccess(pm,token,type);
return;
}
pm.report(token,"String_Node_Str" + token);
return;
}
pm.report(token,"String_Node_Str" + token);
return;
}