This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
public interface Interface <T> { void method(T obj); } public enum NewEnum implements Interface<Integer> { ENUM1 { public void method(Integer obj) { } }; } public class Main { public static void main(String[] args) { NewEnum newe = NewEnum.ENUM1; newe.method(new Integer(1)); // error here } } When I try to compile this code, the following error occurs: Compiling 3 source files to C:\Documents and Settings\opd132\My Documents\NetBeansProjects\EnumTest\build\classes C:\NetBeansProjects\EnumTest\src\enumtest\Main.java:15: cannot find symbol symbol : method method(java.lang.Integer) location: class enumtest.NewEnum newe.method(new Integer(1)); 1 error BUILD FAILED (total time: 1 second)
*** Issue 121454 has been marked as a duplicate of this issue. ***
Sorry, but this appears to be a bug in JDK/javac not in the NetBeans IDE (the NB IDE uses ant and command line javac to do the build). We can improve the in-IDE parser to handle this situation correctly, but we cannot fix the compiler that is used to perform the build - sorry. Two action items for us: -jlahoda: file a bug against javac -dbalek: try to fix this problem in the in-IDE parser
Honza, please once you report an issue against javac, write a note here with the bug number. Thank in advance.
I've tried to compile this code using javac, and the error occurs too. Using Eclipse it works fine.
Problem in the IDE parser fixed. Reassigning to Honza.
I found an old issue against javac about this bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6330385 There is a work arround for this bug that is compile enum class first. Is there a way to force netbeans compile enum class first?
IDE parser fixed. Bug already reported against javac.