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.
externally to the IDE, i added a bunch of source files to a project and when i returned to the IDE and expanded one of nodes in the Projects view the attached exceptions were thrown. using build: 040816
Created attachment 16940 [details] stack trace of exception after adding sources
Tom, please evaluate. Exceptions is thrown from classfile module. java.lang.IllegalArgumentException: invalid constant pool type: 0 at ConstantPool.getConstantPoolEntry(ConstantPool.java:236)
The exception is thrown when a corrupt classfile is detected, which is as designed (according the JVM spec, a zero constant pool index is illegal). The classfile module is working correctly. The real problem is that javacore's ClassReader.getClassFile() doesn't catch IllegalArgumentException in its list of exceptions from bad classfiles. Looking over all the exceptions this client needs to catch from a single load call, I think classfile needs a BadClassFileException to encapsulate these more-specific errors so classfile clients don't need to work so hard. I'll add this class and then update ClassReader to use it instead.
The different exceptions that can be thrown during constant pool loading are now caught, and IOException is thrown instead. When using the individual API these different exceptions make sense (such as IndexOutOfBoundsException for an out-of-bounds pool index), but all that matters to the client during loading is whether the class loaded successfully or not.
*** Issue 47612 has been marked as a duplicate of this issue. ***
*** Issue 47720 has been marked as a duplicate of this issue. ***