Community
Participate
Working Groups
//BugDemo.java interface Foo { public boolean bar(); } enum BugDemo { CONSTANT(new Foo() { public boolean bar() { //marker on bar(): "This method must return a result of type boolean" return true; } }); BugDemo(Foo foo) { } }
build 3.1m6
Problem is in parser which discard the statements inside the #bar() method.
Enum constants are parsed during diet parse and this parse jump over method body. We must force the no diet mode for enum constant arguments.
inside the grammar EnumConstantHeader ::= EnumConstantHeaderName Argumentsopt must be replaced by EnumConstantHeader ::= EnumConstantHeaderName ForceNoDiet Argumentsopt RestoreDiet
Fixed and test added EnumTest#test101()
Verified in I20050510-0010 + JDT/Core v_556