Program: 84275
Project: 84275
Buggy source:
@Override public void parse(IParserManager pm,IToken token){
  int type=token.type();
switch (this.mode) {
case END:
    if (type == Tokens.SYMBOL_IDENTIFIER) {
      final Name name=token.nameValue();
      if (name == Names.qmark) {
        this.type=new OptionType(this.type);
        return;
      }
      if (name == Names.times) {
        this.type=new ReferenceType(this.type);
        return;
      }
    }
  if (this.type != null) {
    this.consumer.setType(this.type);
  }
pm.popParser(true);
return;
case NAME:
switch (type) {
case DyvilSymbols.AT:
Annotation a=new Annotation();
pm.pushParser(pm.newAnnotationParser(a));
this.type=new AnnotatedType(a);
this.mode=ANNOTATION_END;
return;
case BaseSymbols.OPEN_PARENTHESIS:
TupleType tupleType=new TupleType();
pm.pushParser(new TypeListParser(tupleType));
this.type=tupleType;
this.mode=TUPLE_END;
return;
case BaseSymbols.OPEN_SQUARE_BRACKET:
this.mode=ARRAY_COLON;
ArrayType at=new ArrayType();
this.type=at;
pm.pushParser(pm.newTypeParser(at));
return;
case DyvilSymbols.ARROW_OPERATOR:
LambdaType lt=new LambdaType();
this.type=lt;
pm.pushParser(pm.newTypeParser(lt));
this.mode=LAMBDA_END;
return;
case DyvilKeywords.NULL:
this.consumer.setType(Types.NULL);
pm.popParser();
return;
case DyvilSymbols.WILDCARD:
this.type=new WildcardType(token.raw());
this.mode=WILDCARD_TYPE;
return;
}
if (ParserUtil.isIdentifier(type)) {
IToken next=token.next();
switch (next.type()) {
case BaseSymbols.OPEN_SQUARE_BRACKET:
this.type=new NamedGenericType(token.raw(),token.nameValue(),this.parentType);
this.mode=GENERICS;
return;
case DyvilSymbols.ARROW_OPERATOR:
if (this.parentType == null) {
LambdaType lt=new LambdaType(new NamedType(token.raw(),token.nameValue()));
this.type=lt;
this.mode=LAMBDA_END;
pm.skip();
pm.pushParser(pm.newTypeParser(lt));
return;
}
break;
case BaseSymbols.DOT:
NamedType namedType=new NamedType(token.raw(),token.nameValue(),this.parentType);
TypeParser parser=new TypeParser(this);
parser.parentType=namedType;
pm.pushParser(parser);
pm.skip();
this.mode=END;
return;
}
this.type=new NamedType(token.raw(),token.nameValue(),this.parentType);
this.mode=END;
return;
}
if (ParserUtil.isTerminator(type)) {
pm.popParser(true);
return;
}
pm.report(MarkerMessages.createSyntaxError(token,"String_Node_Str",token.toString()));
return;
case TUPLE_END:
if (type != BaseSymbols.CLOSE_PARENTHESIS) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
IToken next=token.next();
int nextType=next.type();
if (nextType == DyvilSymbols.ARROW_OPERATOR) {
TupleType tupleType=(TupleType)this.type;
this.type=new LambdaType(tupleType);
this.mode=LAMBDA_TYPE;
return;
}
this.type.expandPosition(token);
this.mode=END;
return;
case LAMBDA_TYPE:
pm.pushParser(pm.newTypeParser((LambdaType)this.type));
this.mode=LAMBDA_END;
return;
case LAMBDA_END:
this.type.expandPosition(token.prev());
this.consumer.setType(this.type);
pm.popParser(true);
return;
case ARRAY_COLON:
if (type == BaseSymbols.COLON) {
this.mode=ARRAY_END;
MapType mt=new MapType(this.type.getElementType(),null);
this.type=mt;
pm.pushParser(new TypeParser(mt::setValueType));
return;
}
case ARRAY_END:
this.type.expandPosition(token);
this.mode=END;
if (type != BaseSymbols.CLOSE_SQUARE_BRACKET) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
return;
case GENERICS:
if (type == BaseSymbols.OPEN_SQUARE_BRACKET) {
pm.pushParser(new TypeListParser((GenericType)this.type));
this.mode=GENERICS_END;
return;
}
this.type.expandPosition(token.prev());
this.consumer.setType(this.type);
pm.popParser(true);
return;
case WILDCARD_TYPE:
Name name=token.nameValue();
WildcardType wt=(WildcardType)this.type;
if (name == Names.ltcolon) {
wt.setVariance(Variance.COVARIANT);
pm.pushParser(pm.newTypeParser(wt));
this.mode=END;
return;
}
if (name == Names.gtcolon) {
wt.setVariance(Variance.CONTRAVARIANT);
pm.pushParser(pm.newTypeParser(wt));
this.mode=END;
return;
}
this.consumer.setType(this.type);
pm.popParser(true);
return;
case GENERICS_END:
this.mode=END;
if (type != BaseSymbols.CLOSE_SQUARE_BRACKET) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
return;
case ANNOTATION_END:
this.mode=END;
pm.pushParser(pm.newTypeParser((ITyped)this.type),true);
return;
}
}

Fixed version (ground truth):
@Override public void parse(IParserManager pm,IToken token){
  int type=token.type();
switch (this.mode) {
case END:
    if (type == Tokens.SYMBOL_IDENTIFIER) {
      final Name name=token.nameValue();
      if (name == Names.qmark) {
        this.type=new OptionType(this.type);
        return;
      }
      if (name == Names.times) {
        this.type=new ReferenceType(this.type);
        return;
      }
    }
  if (this.type != null) {
    this.consumer.setType(this.type);
  }
pm.popParser(true);
return;
case NAME:
switch (type) {
case DyvilSymbols.AT:
Annotation a=new Annotation();
pm.pushParser(pm.newAnnotationParser(a));
this.type=new AnnotatedType(a);
this.mode=ANNOTATION_END;
return;
case BaseSymbols.OPEN_PARENTHESIS:
TupleType tupleType=new TupleType();
pm.pushParser(new TypeListParser(tupleType));
this.type=tupleType;
this.mode=TUPLE_END;
return;
case BaseSymbols.OPEN_SQUARE_BRACKET:
this.mode=ARRAY_COLON;
ArrayType at=new ArrayType();
this.type=at;
pm.pushParser(pm.newTypeParser(at));
return;
case DyvilSymbols.ARROW_OPERATOR:
LambdaType lt=new LambdaType();
lt.setPosition(token.raw());
this.type=lt;
pm.pushParser(pm.newTypeParser(lt));
this.mode=LAMBDA_END;
return;
case DyvilKeywords.NULL:
this.consumer.setType(Types.NULL);
pm.popParser();
return;
case DyvilSymbols.WILDCARD:
this.type=new WildcardType(token.raw());
this.mode=WILDCARD_TYPE;
return;
}
if (ParserUtil.isIdentifier(type)) {
IToken next=token.next();
switch (next.type()) {
case BaseSymbols.OPEN_SQUARE_BRACKET:
this.type=new NamedGenericType(token.raw(),token.nameValue(),this.parentType);
this.mode=GENERICS;
return;
case DyvilSymbols.ARROW_OPERATOR:
if (this.parentType == null) {
LambdaType lt=new LambdaType(new NamedType(token.raw(),token.nameValue()));
lt.setPosition(next.raw());
this.type=lt;
this.mode=LAMBDA_END;
pm.skip();
pm.pushParser(pm.newTypeParser(lt));
return;
}
break;
case BaseSymbols.DOT:
NamedType namedType=new NamedType(token.raw(),token.nameValue(),this.parentType);
TypeParser parser=new TypeParser(this);
parser.parentType=namedType;
pm.pushParser(parser);
pm.skip();
this.mode=END;
return;
}
this.type=new NamedType(token.raw(),token.nameValue(),this.parentType);
this.mode=END;
return;
}
if (ParserUtil.isTerminator(type)) {
pm.popParser(true);
return;
}
pm.report(MarkerMessages.createSyntaxError(token,"String_Node_Str",token.toString()));
return;
case TUPLE_END:
if (type != BaseSymbols.CLOSE_PARENTHESIS) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
IToken next=token.next();
int nextType=next.type();
if (nextType == DyvilSymbols.ARROW_OPERATOR) {
TupleType tupleType=(TupleType)this.type;
this.type=new LambdaType(tupleType);
this.type.setPosition(next.raw());
this.mode=LAMBDA_TYPE;
return;
}
this.type.expandPosition(token);
this.mode=END;
return;
case LAMBDA_TYPE:
pm.pushParser(pm.newTypeParser((LambdaType)this.type));
this.mode=LAMBDA_END;
return;
case LAMBDA_END:
this.type.expandPosition(token.prev());
this.consumer.setType(this.type);
pm.popParser(true);
return;
case ARRAY_COLON:
if (type == BaseSymbols.COLON) {
this.mode=ARRAY_END;
MapType mt=new MapType(this.type.getElementType(),null);
this.type=mt;
pm.pushParser(new TypeParser(mt::setValueType));
return;
}
case ARRAY_END:
this.type.expandPosition(token);
this.mode=END;
if (type != BaseSymbols.CLOSE_SQUARE_BRACKET) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
return;
case GENERICS:
if (type == BaseSymbols.OPEN_SQUARE_BRACKET) {
pm.pushParser(new TypeListParser((GenericType)this.type));
this.mode=GENERICS_END;
return;
}
this.type.expandPosition(token.prev());
this.consumer.setType(this.type);
pm.popParser(true);
return;
case WILDCARD_TYPE:
Name name=token.nameValue();
WildcardType wt=(WildcardType)this.type;
if (name == Names.ltcolon) {
wt.setVariance(Variance.COVARIANT);
pm.pushParser(pm.newTypeParser(wt));
this.mode=END;
return;
}
if (name == Names.gtcolon) {
wt.setVariance(Variance.CONTRAVARIANT);
pm.pushParser(pm.newTypeParser(wt));
this.mode=END;
return;
}
this.consumer.setType(this.type);
pm.popParser(true);
return;
case GENERICS_END:
this.mode=END;
if (type != BaseSymbols.CLOSE_SQUARE_BRACKET) {
pm.reparse();
pm.report(token,"String_Node_Str");
}
return;
case ANNOTATION_END:
this.mode=END;
pm.pushParser(pm.newTypeParser((ITyped)this.type),true);
return;
}
}