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 32303 - Signed jh.jar parsed on Solaris
Summary: Signed jh.jar parsed on Solaris
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 3.x
Hardware: Sun Solaris
: P1 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: PERFORMANCE
Depends on: 22455 32576
Blocks: 31676
  Show dependency tree
 
Reported: 2003-03-25 14:57 UTC by Jesse Glick
Modified: 2008-12-23 08:37 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Suggested patch (trunk or r35); no change to jh.jar binary needed (4.51 KB, patch)
2003-04-02 17:28 UTC, Jesse Glick
Details | Diff
Binary patch; should work in 3.5; save as $nbhome/lib/patches/32303.jar (17.58 KB, application/octet-stream)
2003-04-02 17:33 UTC, Jesse Glick
Details
Slightly refined patch - permits XTest to run correctly; no difference in normal IDE usage (4.58 KB, patch)
2003-04-02 23:00 UTC, Jesse Glick
Details | Diff
Yet-again-revised patch (previous attachment did not work) (4.62 KB, patch)
2003-04-02 23:26 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2003-03-25 14:57:00 UTC
On Solaris, due to fix of issue 22455, the jh.jar
is prepended
to the bootclasspath, which means its manifest is
parsed during the startup using jar:file: URL.

Moreover, the workaround from #22455 is active
even if I use different JDK which don't link the
jh library.
Comment 1 Jesse Glick 2003-03-25 15:03:55 UTC
Seems like it is not critical for 3.5, but someone else can decide.
~1000msec (out of how much total?) according to log in issue #31676.

Alternative would be to fix #22455 differently - mask javax.help.**
and com.sun.java.help.** from the bootclasspath using NbInstaller.

Or to remove signatures from jh.jar.

What code exactly is parsing it?
Comment 2 Petr Nejedly 2003-03-26 08:54:42 UTC
it is the code scanning for modules on the classpath,
ModuleSystem.loadBootModules() (shortened):

ClassLoader loader = ModuleSystem.class.getClassLoader();
Enumeration e = loader.getResources("META-INF/MANIFEST.MF"); // NOI1
while (e.hasMoreElements()) {
    URL manifestUrl = (URL)e.nextElement();
    InputStream is = manifestUrl.openStream();

We are already filtering JDK libraries from this list because
of signatures, so we may add a rule for jh (which itself is not
a module).
Comment 3 Petr Nejedly 2003-03-31 16:27:06 UTC
"Seems like it is not critical for 3.5"
On the other hand, it is quite cheap startup time improvement.
(~1s out of ~20s -> 5%)

Trung, please decide.
Comment 4 _ ttran 2003-04-02 11:56:14 UTC
3.5 is about performance.  Jesse please let this fix in.  Thx
Comment 5 Jesse Glick 2003-04-02 17:16:24 UTC
Also JDK (not JRE) JARs and $nbhome/lib/ext/*.jar were being checked,
which they did not need to be; and issue #32576 meant that all these
were actually checked twice. Have patch which restricts parsing to
just core.jar, openide.jar, and core-windows.jar, which is how it
should be. NB's jh.jar is not parsed even if
/usr/j2se/opt/javahelp/lib/jhall.jar exists.

If you add other modules to the classpath used for core/openide they
are however correctly included as before, e.g.:

/space/src/nb_all/nbbuild/netbeans/bin/runide.sh -userdir /ram/testme
-J-Dorg.netbeans.core.modules=0 -J-Dorg.netbeans.log.startup=print
-J-Dnetbeans.classpath=/space/src/nb_all/sysprops/netbeans/modules/sysprops.jar
2>&1 | egrep 'Checking boot manifest:|got all manifests|ignoredPrefixes'
[org.netbeans.core.modules #3]
ignoredPrefixes=[jar:file:/space/jdk1.4.2-beta-b19/,
jar:file:/space/src/nb_all/nbbuild/netbeans/lib/ext/,
jar:file:/space/src/nb_all/nbbuild/netbeans/modules/autoload/ext/]
            @1478 - got all manifests dT=1
[org.netbeans.core.modules #3] Checking boot manifest:
jar:file:/space/src/nb_all/sysprops/netbeans/modules/sysprops.jar!/META-INF/MANIFEST.MF
[org.netbeans.core.modules #3] Checking boot manifest:
jar:file:/space/src/nb_all/nbbuild/netbeans/lib/core.jar!/META-INF/MANIFEST.MF
[org.netbeans.core.modules #3] Checking boot manifest:
jar:file:/space/src/nb_all/nbbuild/netbeans/lib/openide.jar!/META-INF/MANIFEST.MF
[org.netbeans.core.modules #3] Checking boot manifest:
jar:file:/space/src/nb_all/nbbuild/netbeans/lib/core-windows.jar!/META-INF/MANIFEST.MF

Only tested on Linux so far (JDK 1.3 and 1.4), needs checking on both
Solaris and Windows (on both JDK 1.3 and 1.4).
Comment 6 Jesse Glick 2003-04-02 17:28:15 UTC
Created attachment 9667 [details]
Suggested patch (trunk or r35); no change to jh.jar binary needed
Comment 7 Jesse Glick 2003-04-02 17:33:23 UTC
Created attachment 9668 [details]
Binary patch; should work in 3.5; save as $nbhome/lib/patches/32303.jar
Comment 8 Jesse Glick 2003-04-02 17:47:39 UTC
Petr, I would appreciate a review of the diff.
Comment 9 Jesse Glick 2003-04-02 23:00:41 UTC
Created attachment 9672 [details]
Slightly refined patch - permits XTest to run correctly; no difference in normal IDE usage
Comment 10 Jesse Glick 2003-04-02 23:26:55 UTC
Created attachment 9673 [details]
Yet-again-revised patch (previous attachment did not work)
Comment 11 Jesse Glick 2003-04-03 01:13:42 UTC
Fixed in trunk:

committed     Up-To-Date  1.35       
core/src/org/netbeans/core/modules/ModuleSystem.java
Comment 12 Petr Nejedly 2003-04-03 07:30:07 UTC
The patch seems OK to me. Reviewed.
Comment 13 _ ttran 2003-04-03 13:12:20 UTC
Marian, please verify the patch.  If it works consider this as
approved by me for r35
Comment 14 Marian Mirilovic 2003-04-03 14:01:32 UTC
patch verified
Comment 15 Jesse Glick 2003-04-03 14:41:57 UTC
Merged:

ModuleSystem.java 1.33.2.1
Comment 16 Petr Nejedly 2003-04-03 15:29:48 UTC
Verified startup speedup in release35 branch.