Program: 61992
Project: 61992
Buggy source:
public static ValueKind parseValue(ConstantPool constants,Flasm3Lexer lexer) throws IOException, ParseException {
  ParsedSymbol type=lexer.lex();
  ParsedSymbol value;
  int value_index=0;
  int value_kind=0;
switch (type.type) {
case ParsedSymbol.TYPE_KEYWORD_INTEGER:
    value_kind=ValueKind.CONSTANT_Int;
  expected(ParsedSymbol.TYPE_PARENT_OPEN,"String_Node_Str",lexer);
value=lexer.lex();
expected(value,ParsedSymbol.TYPE_INTEGER,"String_Node_Str");
expected(ParsedSymbol.TYPE_PARENT_CLOSE,"String_Node_Str",lexer);
value_index=constants.getIntId((Long)value.value,true);
break;
case ParsedSymbol.TYPE_KEYWORD_UINTEGER:
value_kind=ValueKind.CONSTANT_UInt;
expected(ParsedSymbol.TYPE_PARENT_OPEN,"String_Node_Str",lexer);
value=lexer.lex();
expected(value,ParsedSymbol.TYPE_INTEGER,"String_Node_Str");
expected(ParsedSymbol.TYPE_PARENT_CLOSE,"String_Node_Str",lexer);
value_index=constants.getUIntId((Long)value.value,true);
break;
case ParsedSymbol.TYPE_KEYWORD_DOUBLE:
value_kind=ValueKind.CONSTANT_Double;
expected(ParsedSymbol.TYPE_PARENT_OPEN,"String_Node_Str",lexer);
value=lexer.lex();
expected(value,ParsedSymbol.TYPE_FLOAT,"String_Node_Str");
expected(ParsedSymbol.TYPE_PARENT_CLOSE,"String_Node_Str",lexer);
value_index=constants.getDoubleId((Double)value.value,true);
break;
case ParsedSymbol.TYPE_KEYWORD_UTF8:
value_kind=ValueKind.CONSTANT_Utf8;
expected(ParsedSymbol.TYPE_PARENT_OPEN,"String_Node_Str",lexer);
value=lexer.lex();
expected(value,ParsedSymbol.TYPE_STRING,"String_Node_Str");
expected(ParsedSymbol.TYPE_PARENT_CLOSE,"String_Node_Str",lexer);
value_index=constants.getStringId((String)value.value,true);
break;
case ParsedSymbol.TYPE_KEYWORD_TRUE:
value_kind=ValueKind.CONSTANT_True;
break;
case ParsedSymbol.TYPE_KEYWORD_FALSE:
value_kind=ValueKind.CONSTANT_False;
break;
case ParsedSymbol.TYPE_KEYWORD_NULL:
value_kind=ValueKind.CONSTANT_Null;
break;
case ParsedSymbol.TYPE_KEYWORD_NAMESPACE:
case ParsedSymbol.TYPE_KEYWORD_PACKAGEINTERNALNS:
case ParsedSymbol.TYPE_KEYWORD_PROTECTEDNAMESPACE:
case ParsedSymbol.TYPE_KEYWORD_EXPLICITNAMESPACE:
case ParsedSymbol.TYPE_KEYWORD_STATICPROTECTEDNS:
case ParsedSymbol.TYPE_KEYWORD_PRIVATENAMESPACE:
case ParsedSymbol.TYPE_KEYWORD_PACKAGENAMESPACE:
switch (type.type) {
case ParsedSymbol.TYPE_KEYWORD_NAMESPACE:
value_kind=ValueKind.CONSTANT_Namespace;
break;
case ParsedSymbol.TYPE_KEYWORD_PACKAGEINTERNALNS:
value_kind=ValueKind.CONSTANT_PackageInternalNs;
break;
case ParsedSymbol.TYPE_KEYWORD_PROTECTEDNAMESPACE:
value_kind=ValueKind.CONSTANT_ProtectedNamespace;
break;
case ParsedSymbol.TYPE_KEYWORD_EXPLICITNAMESPACE:
value_kind=ValueKind.CONSTANT_ExplicitNamespace;
break;
case ParsedSymbol.TYPE_KEYWORD_STATICPROTECTEDNS:
value_kind=ValueKind.CONSTANT_StaticProtectedNs;
break;
case ParsedSymbol.TYPE_KEYWORD_PRIVATENAMESPACE:
value_kind=ValueKind.CONSTANT_PrivateNs;
break;
case ParsedSymbol.TYPE_KEYWORD_PACKAGENAMESPACE:
value_kind=ValueKind.CONSTANT_PackageNamespace;
break;
}
lexer.pushback(type);
value_index=parseNamespace(constants,lexer);
break;
}
return new ValueKind(value_index,value_kind);
}

Fixed version (ground truth):
public static ValueKind parseValue(ConstantPool constants,Flasm3Lexer lexer) throws IOException, ParseException {
  ParsedSymbol type=lexer.lex();
  ParsedSymbol value;
  int value_index=0;
  int value_kind=0;
switch (type.type) {
case ParsedSymbol.TYPE_KEYWORD_INTEGER:
    value_kind=ValueKind.CONSTANT_Int;
  expected(ParsedSymbol.TYPE_PARENT_OPEN,"String_Node_Str",lexer);
value=lexer.lex();
if (value.type == ParsedSymbol.TYPE_KEYWORD_NULL) {
value_index=0;
}
 else {
expected(value,ParsedSymbol.TYPE_INTEGER,"String_Node_Str");
value_index=constants.getIntId((Long)value.value,true);
}
expected(ParsedSymbol.TYPE_PARENT_CLOSE,"String_Node_Str",lexer);
break;
case ParsedSymbol.TYPE_KEYWORD_UINTEGER:
value_kind=ValueKind.CONSTANT_UInt;
expected(ParsedSymbol.TYPE_PARENT_OPEN,"String_Node_Str",lexer);
value=lexer.lex();
if (value.type == ParsedSymbol.TYPE_KEYWORD_NULL) {
value_index=0;
}
 else {
expected(value,ParsedSymbol.TYPE_INTEGER,"String_Node_Str");
value_index=constants.getUIntId((Long)value.value,true);
}
expected(ParsedSymbol.TYPE_PARENT_CLOSE,"String_Node_Str",lexer);
break;
case ParsedSymbol.TYPE_KEYWORD_DOUBLE:
value_kind=ValueKind.CONSTANT_Double;
expected(ParsedSymbol.TYPE_PARENT_OPEN,"String_Node_Str",lexer);
value=lexer.lex();
if (value.type == ParsedSymbol.TYPE_KEYWORD_NULL) {
value_index=0;
}
 else {
expected(value,ParsedSymbol.TYPE_FLOAT,"String_Node_Str");
value_index=constants.getDoubleId((Double)value.value,true);
}
expected(ParsedSymbol.TYPE_PARENT_CLOSE,"String_Node_Str",lexer);
break;
case ParsedSymbol.TYPE_KEYWORD_UTF8:
value_kind=ValueKind.CONSTANT_Utf8;
expected(ParsedSymbol.TYPE_PARENT_OPEN,"String_Node_Str",lexer);
value=lexer.lex();
if (value.type == ParsedSymbol.TYPE_KEYWORD_NULL) {
value_index=0;
}
 else {
expected(value,ParsedSymbol.TYPE_STRING,"String_Node_Str");
expected(ParsedSymbol.TYPE_PARENT_CLOSE,"String_Node_Str",lexer);
value_index=constants.getStringId((String)value.value,true);
}
break;
case ParsedSymbol.TYPE_KEYWORD_TRUE:
value_kind=ValueKind.CONSTANT_True;
break;
case ParsedSymbol.TYPE_KEYWORD_FALSE:
value_kind=ValueKind.CONSTANT_False;
break;
case ParsedSymbol.TYPE_KEYWORD_NULL:
value_kind=ValueKind.CONSTANT_Null;
break;
case ParsedSymbol.TYPE_KEYWORD_NAMESPACE:
case ParsedSymbol.TYPE_KEYWORD_PACKAGEINTERNALNS:
case ParsedSymbol.TYPE_KEYWORD_PROTECTEDNAMESPACE:
case ParsedSymbol.TYPE_KEYWORD_EXPLICITNAMESPACE:
case ParsedSymbol.TYPE_KEYWORD_STATICPROTECTEDNS:
case ParsedSymbol.TYPE_KEYWORD_PRIVATENAMESPACE:
case ParsedSymbol.TYPE_KEYWORD_PACKAGENAMESPACE:
switch (type.type) {
case ParsedSymbol.TYPE_KEYWORD_NAMESPACE:
value_kind=ValueKind.CONSTANT_Namespace;
break;
case ParsedSymbol.TYPE_KEYWORD_PACKAGEINTERNALNS:
value_kind=ValueKind.CONSTANT_PackageInternalNs;
break;
case ParsedSymbol.TYPE_KEYWORD_PROTECTEDNAMESPACE:
value_kind=ValueKind.CONSTANT_ProtectedNamespace;
break;
case ParsedSymbol.TYPE_KEYWORD_EXPLICITNAMESPACE:
value_kind=ValueKind.CONSTANT_ExplicitNamespace;
break;
case ParsedSymbol.TYPE_KEYWORD_STATICPROTECTEDNS:
value_kind=ValueKind.CONSTANT_StaticProtectedNs;
break;
case ParsedSymbol.TYPE_KEYWORD_PRIVATENAMESPACE:
value_kind=ValueKind.CONSTANT_PrivateNs;
break;
case ParsedSymbol.TYPE_KEYWORD_PACKAGENAMESPACE:
value_kind=ValueKind.CONSTANT_PackageNamespace;
break;
}
lexer.pushback(type);
value_index=parseNamespace(constants,lexer);
break;
}
return new ValueKind(value_index,value_kind);
}