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.

Bug 47438 - IllegalArgumentException after adding files to project src dir outside IDE
Summary: IllegalArgumentException after adding files to project src dir outside IDE
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Classfile (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: _ tball
URL:
Keywords:
: 47612 47720 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-08-19 09:43 UTC by gc
Modified: 2004-09-02 09:54 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stack trace of exception after adding sources (4.99 KB, text/plain)
2004-08-19 09:44 UTC, gc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gc 2004-08-19 09:43:52 UTC
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
Comment 1 gc 2004-08-19 09:44:56 UTC
Created attachment 16940 [details]
stack trace of exception after adding sources
Comment 2 Jan Becicka 2004-08-19 10:00:10 UTC
Tom, please evaluate. 
Exceptions is thrown from classfile module.
java.lang.IllegalArgumentException: invalid constant pool type: 0
at ConstantPool.getConstantPoolEntry(ConstantPool.java:236)
Comment 3 _ tball 2004-08-19 15:27:51 UTC
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.
Comment 4 _ tball 2004-08-19 21:50:11 UTC
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.
Comment 5 _ tball 2004-08-21 21:09:03 UTC
*** Issue 47612 has been marked as a duplicate of this issue. ***
Comment 6 Jan Becicka 2004-09-02 09:54:03 UTC
*** Issue 47720 has been marked as a duplicate of this issue. ***