Community
Participate
Working Groups
Eclipse incorrectly compiles the following: enum BugDemo { FOO() { static int bar; } } javac gives the error: Foo.java:3: inner classes cannot have static declarations static int baz; ^ 1 error
The problem comes from line 72 in org.eclipse.jdt.internal.compiler.ast.FieldDeclaration. We exclude wrongly enum from the check.
Bug was found in 3.1M6
Added EnumTest#test113. Indeed, the #isClass() check can be removed, as subsequent #isStatic() check is all we need here. Fixed
Verified in N20050606-0010 + JDT/Core HEAD
Verified in I20050610-0010