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: | Release locks on disabled module's jar | ||
---|---|---|---|
Product: | platform | Reporter: | Jiri Rechtacek <jrechtacek> |
Component: | Module System | Assignee: | Jiri Rechtacek <jrechtacek> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | jglick |
Priority: | P3 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 20323 | ||
Attachments: | implementation draft #1 |
Description
Jiri Rechtacek
2005-07-15 13:15:26 UTC
Blocks Uninstall feature (issue 20323) on Windows OS. Please also enhance ModuleManagerTest.testModuleDeletion to check that it works. Created attachment 23161 [details]
implementation draft #1
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 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. 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 Marking this issue as VERIFIED since the issue reporter == issue owner. |