Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 61028 - Release locks on disabled module's jar
Release locks on disabled module's jar
Status: VERIFIED FIXED
Product: platform
Classification: Unclassified
Component: Module System
5.x
All All
: P3 (vote)
: 5.x
Assigned To: Jiri Rechtacek
issues@platform
:
Depends on:
Blocks: 20323
  Show dependency treegraph
 
Reported: 2005-07-15 13:15 UTC by Jiri Rechtacek
Modified: 2008-12-23 08:39 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments
implementation draft #1 (1.88 KB, patch)
2005-07-19 17:28 UTC, Jiri Rechtacek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Rechtacek 2005-07-15 13:15:26 UTC
Processing of module disable should handle locks on module's jar file.
JarClassLoader.releaseLocks() has been called only on Module.destroy() and
should be called on Module.setEnabled(false) too.
Comment 1 Jiri Rechtacek 2005-07-15 13:16:28 UTC
Blocks Uninstall feature (issue 20323) on Windows OS.
Comment 2 Jesse Glick 2005-07-15 15:34:51 UTC
Please also enhance ModuleManagerTest.testModuleDeletion to check that it works.
Comment 3 Jiri Rechtacek 2005-07-19 17:28:43 UTC
Created attachment 23161 [details]
implementation draft #1
Comment 4 Jiri Rechtacek 2005-07-19 17:36:07 UTC
Jesse, please for check up attached diff.
I'm not with implementation. I have removed a responsibility of releasing locks
from Module.destroy() for Module.classLoaderDown() but I have gone into problems
when appears a sequence module: disable->enable->disable. If disable() is called
on a recently disabled module then JCL throws ISE: Already had dead JARs.
In my draft I ignore this ISE and then ModuleManagerTest passes and it works for
me also in real. Please could you review if I'm on the right way? Thanks
Comment 5 Jesse Glick 2005-07-19 18:38:25 UTC
If you are getting the ISE you are doing something wrong; should really be an
assertion error, I guess, but probably written before we were using JDK 1.4.

The patch has some mistakes. moduleJARs.remove(jar) must remain in destroy(); it
is the opposite of what is done in the Module constructor. And oldClassLoaders
*accumulates* class loaders (added to in every classLoaderUp), so it makes no
sense to iterate *all* of them with every disable.

You need to take a different approach, I think. Leave moduleJARs.remove(jar) in
destroy(). Remove the oldClassLoaders field entirely. Remove the releaseLocks()
method in JCL; instead, override PCL.destroy() in JCL to call super and then do
what releaseLocks() currently does. Note that Module.classLoaderDown() already
calls PCL.destroy(), so that should do what you want.

(I don't really remember why I didn't release locks in classLoaderDown to begin
with, but see if it works again.)

BTW when making a patch, it is more readable to delete lines than to comment
them out.
Comment 6 Jiri Rechtacek 2005-07-20 14:34:52 UTC
Thanks for cue. It works for me now in any manner.

Checking in core/bootstrap/src/org/netbeans/Module.java;
/cvs/core/bootstrap/src/org/netbeans/Module.java,v  <--  Module.java
new revision: 1.2; previous revision: 1.1
done
Checking in core/bootstrap/src/org/netbeans/JarClassLoader.java;
/cvs/core/bootstrap/src/org/netbeans/JarClassLoader.java,v  <--  JarClassLoader.java
new revision: 1.18; previous revision: 1.17
done
Comment 7 Jaromir Uhrik 2006-01-16 15:45:40 UTC
Marking this issue as VERIFIED since the issue reporter == issue owner.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo