| Summary: | [1.5][compiler] Compiler incorrectly allows static declarations in enum constants. | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | David Gates <gatesda> |
| Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | ||
| Version: | 3.1 | ||
| Target Milestone: | 3.1 RC2 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
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 |
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