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.
Summary: | IllegalArgumentException after adding files to project src dir outside IDE | ||
---|---|---|---|
Product: | java | Reporter: | gc <gc-nb> |
Component: | Classfile | Assignee: | _ tball <tball> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 4.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | stack trace of exception after adding sources |
Description
gc
2004-08-19 09:43:52 UTC
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. *** |