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 7181 - The wrong content of a jar file displayed in the Explorer window
Summary: The wrong content of a jar file displayed in the Explorer window
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P4 minor (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-07-27 16:37 UTC by Faustas Zilinskas
Modified: 2003-06-30 16:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Faustas Zilinskas 2000-07-27 16:37:46 UTC
Scenario:
I add a servlet.jar file (version 2.2 downloaded from java.sun.com) to my
filesystem list in the explorer and try to list the methods of an interface
called javax.servlet.ServletContext. There are (at least) two methods that are
missing in the method list:

public java.lang.String getInitParameter(java.lang.String name)
public java.util.Enumeration getInitParameterNames()

These methods should be displayed, I checked the contents of that servlet.jar
with the javap utility.

Possible problem:
Apparently Forte CE uses an older version of the servlet.jar file which
conforms to the version 2.1 of Servlet specification. This servlet.jar file
defines the same classes and interfaces as the version 2.2 which I'm inspecting
in the explorer. Instead of displaying the contents of
javax.servlet.ServletContext interface from the 2.2 file, Forte displays the
default (internal) version of this class which is 2.1.
Comment 1 Jesse Glick 2000-07-27 17:40:59 UTC
Yes, the module which supports .class files without source currently uses
something like Class.forName to load the class and then use introspection. This
has several problems, for example the problem you mentioned (cannot inspect
other versions of classes if they are already loaded inside the IDE core), and
also for example that any static methods, etc. used in these classes will be run
inside the IDE, which is not too nice.

We are working on making the classloader more restrictive when loading these
classes, but that is only a partial solution. Ideally the clazz module would
parse the .class file (bytecode), rather than using introspection, though this
would be a fair amount of work (for something which is not used that often).
Comment 2 Jan Becicka 2002-01-11 08:59:46 UTC
Reopening
Comment 3 Jan Becicka 2002-01-11 09:01:42 UTC
Clazz module is based on classfile (byte code parser) now.
Comment 4 Jan Becicka 2002-10-15 13:50:41 UTC
Verified in 200210090100
Comment 5 Quality Engineering 2003-06-30 16:44:13 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.