Program: 84577
Project: 84577
Buggy source:
@Override public void parse(IParserManager pm,IToken token) throws SyntaxError {
  int type=token.type();
switch (this.mode) {
case TYPE:
    if (type == Symbols.CLOSE_CURLY_BRACKET) {
      pm.popParser(true);
      return;
    }
  if (type == Symbols.SEMICOLON) {
    if (token.isInferred()) {
      return;
    }
    this.reset();
    return;
  }
if (type == Keywords.NEW) {
  if (this.theClass == null) {
    this.mode=0;
    throw new SyntaxError(token,"String_Node_Str");
  }
  Constructor c=new Constructor(this.theClass);
  c.position=token.raw();
  c.modifiers=this.modifiers;
  c.setAnnotations(this.annotations,this.annotationCount);
  this.member=c;
  this.mode=PARAMETERS;
  return;
}
int i=0;
if ((i=ModifierTypes.MEMBER.parse(type)) != -1) {
this.modifiers|=i;
return;
}
if ((i=ModifierTypes.CLASS_TYPE.parse(type)) != -1) {
IToken next=token.next();
if (!ParserUtil.isIdentifier(next.type())) {
this.reset();
throw new SyntaxError(next,"String_Node_Str");
}
if (this.theClass == null) {
this.reset();
throw new SyntaxError(token,"String_Node_Str");
}
Name name=next.nameValue();
CodeClass codeClass=new CodeClass(next.raw(),this.theClass.getUnit(),this.modifiers | i);
codeClass.setName(name);
codeClass.setAnnotations(this.getAnnotations(),this.annotationCount);
codeClass.setOuterClass(this.theClass);
ClassDeclarationParser parser=new ClassDeclarationParser(this.theClass.getBody(),codeClass);
pm.skip();
pm.pushParser(parser);
this.reset();
return;
}
if (token.nameValue() == Name.at) {
Annotation annotation=new Annotation(token.raw());
this.addAnnotation(annotation);
pm.pushParser(new AnnotationParser(annotation));
return;
}
pm.pushParser(new TypeParser(this),true);
this.mode=NAME;
return;
case NAME:
if (!ParserUtil.isIdentifier(type)) {
this.reset();
throw new SyntaxError(token,"String_Node_Str",true);
}
IToken next=token.next();
type=next.type();
if (type == Symbols.SEMICOLON || type == Symbols.CLOSE_CURLY_BRACKET) {
Field f=new Field(this.theClass,token.nameValue(),this.type);
f.position=token.raw();
f.modifiers=this.modifiers;
f.setAnnotations(this.getAnnotations(),this.annotationCount);
this.consumer.addField(f);
if (type == Symbols.CLOSE_CURLY_BRACKET) {
pm.popParser(true);
return;
}
pm.skip();
this.reset();
return;
}
if (type == Symbols.OPEN_PARENTHESIS) {
this.mode=PARAMETERS;
Method m=new Method(this.theClass,token.nameValue(),this.type);
m.modifiers=this.modifiers;
m.position=token.raw();
m.setAnnotations(this.getAnnotations(),this.annotationCount);
this.member=m;
return;
}
if (type == Symbols.OPEN_CURLY_BRACKET) {
Property p=new Property(this.theClass,token.nameValue(),this.type);
p.position=token.raw();
p.modifiers=this.modifiers;
p.setAnnotations(this.getAnnotations(),this.annotationCount);
this.member=p;
this.mode=FIELD_END;
pm.skip();
pm.pushParser(new PropertyParser(p));
return;
}
if (type == Symbols.EQUALS) {
Field f=new Field(this.theClass,token.nameValue(),this.type);
f.position=token.raw();
f.modifiers=this.modifiers;
f.setAnnotations(this.getAnnotations(),this.annotationCount);
this.member=f;
this.mode=FIELD_END;
pm.skip();
pm.pushParser(new ExpressionParser(f));
return;
}
if (type == Symbols.OPEN_SQUARE_BRACKET) {
Method m=new Method(this.theClass,token.nameValue(),this.type);
m.modifiers=this.modifiers;
m.position=token.raw();
m.setAnnotations(this.getAnnotations(),this.annotationCount);
this.member=m;
this.mode=GENERICS_END;
pm.skip();
pm.pushParser(new TypeVariableListParser(m));
return;
}
this.mode=TYPE;
throw new SyntaxError(token,"String_Node_Str");
case GENERICS_END:
this.mode=PARAMETERS;
if (type == Symbols.CLOSE_SQUARE_BRACKET) {
return;
}
throw new SyntaxError(token,"String_Node_Str",true);
case PARAMETERS:
this.mode=PARAMETERS_END;
if (type == Symbols.OPEN_PARENTHESIS) {
pm.pushParser(new ParameterListParser((IParameterList)this.member));
return;
}
throw new SyntaxError(token,"String_Node_Str",true);
case PARAMETERS_END:
this.mode=METHOD_VALUE;
if (type == Symbols.CLOSE_PARENTHESIS) {
return;
}
throw new SyntaxError(token,"String_Node_Str",true);
case METHOD_VALUE:
if (type == Symbols.CLOSE_CURLY_BRACKET) {
this.consumer.addMethod((IMethod)this.member);
pm.popParser(true);
return;
}
if (type == Symbols.SEMICOLON) {
this.consumer.addMethod((IMethod)this.member);
this.reset();
return;
}
this.mode=METHOD_END;
if (type == Symbols.OPEN_CURLY_BRACKET) {
pm.pushParser(new ExpressionParser((IValueConsumer)this.member),true);
return;
}
if (type == Symbols.EQUALS) {
pm.pushParser(new ExpressionParser((IValueConsumer)this.member));
return;
}
if (type == Keywords.THROWS) {
pm.pushParser(new ExceptionListParser((IExceptionList)this.member));
return;
}
this.mode=TYPE;
throw new SyntaxError(token,"String_Node_Str");
case METHOD_END:
if (this.member instanceof IMethod) {
this.consumer.addMethod((IMethod)this.member);
}
 else {
this.consumer.addConstructor((IConstructor)this.member);
}
pm.reparse();
this.reset();
return;
case FIELD_END:
this.consumer.addField((IField)this.member);
pm.reparse();
this.reset();
return;
case PROPERTY_END:
this.consumer.addProperty((IProperty)this.member);
pm.reparse();
this.reset();
return;
}
}

Fixed version (ground truth):
@Override public void parse(IParserManager pm,IToken token) throws SyntaxError {
  int type=token.type();
switch (this.mode) {
case TYPE:
    if (type == Symbols.CLOSE_CURLY_BRACKET) {
      pm.popParser(true);
      return;
    }
  if (type == Symbols.SEMICOLON) {
    if (token.isInferred()) {
      return;
    }
    this.reset();
    return;
  }
if (type == Keywords.NEW) {
  if (this.theClass == null) {
    this.mode=0;
    throw new SyntaxError(token,"String_Node_Str");
  }
  Constructor c=new Constructor(this.theClass);
  c.position=token.raw();
  c.modifiers=this.modifiers;
  c.setAnnotations(this.annotations,this.annotationCount);
  this.member=c;
  this.mode=PARAMETERS;
  return;
}
int i=0;
if ((i=ModifierTypes.MEMBER.parse(type)) != -1) {
this.modifiers|=i;
return;
}
if ((i=ModifierTypes.CLASS_TYPE.parse(type)) != -1) {
IToken next=token.next();
if (!ParserUtil.isIdentifier(next.type())) {
this.reset();
throw new SyntaxError(next,"String_Node_Str");
}
if (this.theClass == null) {
this.reset();
throw new SyntaxError(token,"String_Node_Str");
}
Name name=next.nameValue();
CodeClass codeClass=new CodeClass(next.raw(),this.theClass.getUnit(),this.modifiers | i);
codeClass.setName(name);
codeClass.setAnnotations(this.getAnnotations(),this.annotationCount);
codeClass.setOuterClass(this.theClass);
ClassDeclarationParser parser=new ClassDeclarationParser(this.theClass.getBody(),codeClass);
pm.skip();
pm.pushParser(parser);
this.reset();
return;
}
if (token.nameValue() == Name.at) {
Annotation annotation=new Annotation(token.raw());
this.addAnnotation(annotation);
pm.pushParser(pm.newAnnotationParser(annotation));
return;
}
pm.pushParser(pm.newTypeParser(this),true);
this.mode=NAME;
return;
case NAME:
if (!ParserUtil.isIdentifier(type)) {
this.reset();
throw new SyntaxError(token,"String_Node_Str");
}
IToken next=token.next();
type=next.type();
if (type == Symbols.SEMICOLON || type == Symbols.CLOSE_CURLY_BRACKET) {
Field f=new Field(this.theClass,token.nameValue(),this.type);
f.position=token.raw();
f.modifiers=this.modifiers;
f.setAnnotations(this.getAnnotations(),this.annotationCount);
this.consumer.addField(f);
if (type == Symbols.CLOSE_CURLY_BRACKET) {
pm.popParser(true);
return;
}
pm.skip();
this.reset();
return;
}
if (type == Symbols.OPEN_PARENTHESIS) {
this.mode=PARAMETERS;
Method m=new Method(this.theClass,token.nameValue(),this.type);
m.modifiers=this.modifiers;
m.position=token.raw();
m.setAnnotations(this.getAnnotations(),this.annotationCount);
this.member=m;
return;
}
if (type == Symbols.OPEN_CURLY_BRACKET) {
Property p=new Property(this.theClass,token.nameValue(),this.type);
p.position=token.raw();
p.modifiers=this.modifiers;
p.setAnnotations(this.getAnnotations(),this.annotationCount);
this.member=p;
this.mode=FIELD_END;
pm.skip();
pm.pushParser(new PropertyParser(p));
return;
}
if (type == Symbols.EQUALS) {
Field f=new Field(this.theClass,token.nameValue(),this.type);
f.position=token.raw();
f.modifiers=this.modifiers;
f.setAnnotations(this.getAnnotations(),this.annotationCount);
this.member=f;
this.mode=FIELD_END;
pm.skip();
pm.pushParser(pm.newExpressionParser(f));
return;
}
if (type == Symbols.OPEN_SQUARE_BRACKET) {
Method m=new Method(this.theClass,token.nameValue(),this.type);
m.modifiers=this.modifiers;
m.position=token.raw();
m.setAnnotations(this.getAnnotations(),this.annotationCount);
this.member=m;
this.mode=GENERICS_END;
pm.skip();
pm.pushParser(new TypeVariableListParser(m));
return;
}
this.mode=TYPE;
throw new SyntaxError(token,"String_Node_Str");
case GENERICS_END:
this.mode=PARAMETERS;
if (type == Symbols.CLOSE_SQUARE_BRACKET) {
return;
}
throw new SyntaxError(token,"String_Node_Str",true);
case PARAMETERS:
this.mode=PARAMETERS_END;
if (type == Symbols.OPEN_PARENTHESIS) {
pm.pushParser(new ParameterListParser((IParameterList)this.member));
return;
}
throw new SyntaxError(token,"String_Node_Str",true);
case PARAMETERS_END:
this.mode=METHOD_VALUE;
if (type == Symbols.CLOSE_PARENTHESIS) {
return;
}
throw new SyntaxError(token,"String_Node_Str",true);
case METHOD_VALUE:
if (type == Symbols.CLOSE_CURLY_BRACKET) {
this.consumer.addMethod((IMethod)this.member);
pm.popParser(true);
return;
}
if (type == Symbols.SEMICOLON) {
this.consumer.addMethod((IMethod)this.member);
this.reset();
return;
}
this.mode=METHOD_END;
if (type == Symbols.OPEN_CURLY_BRACKET) {
pm.pushParser(pm.newExpressionParser((IValueConsumer)this.member),true);
return;
}
if (type == Symbols.EQUALS) {
pm.pushParser(pm.newExpressionParser((IValueConsumer)this.member));
return;
}
if (type == Keywords.THROWS) {
pm.pushParser(new ExceptionListParser((IExceptionList)this.member));
return;
}
this.mode=TYPE;
throw new SyntaxError(token,"String_Node_Str");
case METHOD_END:
if (this.member instanceof IMethod) {
this.consumer.addMethod((IMethod)this.member);
}
 else {
this.consumer.addConstructor((IConstructor)this.member);
}
pm.reparse();
this.reset();
return;
case FIELD_END:
this.consumer.addField((IField)this.member);
pm.reparse();
this.reset();
return;
case PROPERTY_END:
this.consumer.addProperty((IProperty)this.member);
pm.reparse();
this.reset();
return;
}
}