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: | JARFILESYSTEM: when two .jars with the same name are mounted, the second one replaces the first | ||
---|---|---|---|
Product: | platform | Reporter: | Peter W Carlson <pcarlson> |
Component: | -- Other -- | Assignee: | David Strupl <dstrupl> |
Status: | CLOSED FIXED | ||
Severity: | blocker | CC: | jchalupa, jglick, jtulach, ttran |
Priority: | P1 | ||
Version: | 3.x | ||
Hardware: | PC | ||
OS: | Windows ME/2000 | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 20970 | ||
Attachments: |
First (naive) patch
Hotfix patch for release33 branch |
Description
Peter W Carlson
2002-02-26 22:30:21 UTC
How can you have two .jars with the same name but different contents at the same time? Do you mean they have the same filename but live in different directories? Aware of the implementation I can hardly imagine described behaviour. Perhaps conflict of system names in Repository. But jars with the same name must have different path, which is currently part of system name. Evaluation in Orion ea,NB 3.3.1 and in last trunk version: Verified that two different jars with the same name can be added in Repository and all children are corectly presented. I did not find any problem. That`s why marked as WORKSFORME. To reproduce: Mount a web module with a jar file under its WEB-INF/lib, the jar files under WEB-INF/lib will be mounted automatically by ide. Mount a directory which has a somename jar file. right click the jar file and click "Mount JAR". The second jar file will replace the first mounted jar file. It can be seen from jar property. Also see bug 20970. Problem is in automount support. Reproducible also in dev build. How I reproduced this bug: I had two web modules. Both of them contained in WEB-INF/lib the same jars. 1. I mounted first web module => all jars in web1/WEB-INF/lib were mounted as JarFileSystems. 2.Then I mounted the second one . Again all jars in web2/WEB-INF/lib were mounted as JarFileSystems but all jars in web1/WEB-INF/lib were unmounted as JarFileSystems. See stacktraces here: added fs.getSystemName: E:\temp\web2\WEB-INF\lib\js.jar java.lang.Exception: Stack trace at java.lang.Thread.dumpStack(Thread.java:993) at org.openide.filesystems.Repository.addFileSystem(Repository.java:160) at org.netbeans.modules.web.context.WebContextObject$3.run(WebContextObject.java:362) at org.openide.util.Task.run(Task.java:152) at org.openide.util.RequestProcessor$ProcessorThread.run(RequestProcessor.java:622) and : removed fs.getSystemName: E:\temp\web1\WEB-INF\lib\js.jar java.lang.Exception: Stack trace at java.lang.Thread.dumpStack(Thread.java:993) at org.openide.filesystems.Repository.removeFileSystem(Repository.java:209) at org.netbeans.core.AutomountSupport.cycleFileSystems(AutomountSupport.java:586) at org.netbeans.core.AutomountSupport.updateFileSystems(AutomountSupport.java:486) at org.netbeans.core.AutomountSupport.taskFinished(AutomountSupport.java:155) at org.openide.util.Task.notifyFinished(Task.java:123) at org.openide.loaders.FolderInstance.defaultProcessObjects(FolderInstance.java:586) at org.openide.loaders.FolderInstance.access$100(FolderInstance.java:45) at org.openide.loaders.FolderInstance$2.run(FolderInstance.java:456) at org.openide.util.Task.run(Task.java:152) at org.openide.util.RequestProcessor$ProcessorThread.run(RequestProcessor.java:622) The problem is in the fact that automount support uses the same name for representing the second jar file setting. Working on a solution. Created attachment 4883 [details]
First (naive) patch
The first patch solving the issue by not using getDisplayName() at all. Please note that although the name of the file is ugly the user will not see it anywhere in the NetBeans. The only problem it may cause is that the setting file cannot be edited by hand (because you won't know which file to edit). The patch is suitable as hotfix. For 3.4 please work on something better. Created attachment 4902 [details]
Hotfix patch for release33 branch
Could anyone (besides me) test my patch against release33 and specifically when using the web module? Thanks. Fixed in trunk AutoMountSupport 1.42. MountIterator 1.18. Hotfix applied to branches orion_ea and orion_fcs. verified in [FFJ4.0_EA](020301_1EE) && [nb_dev](20020304) verified in [orion_CE](20020401) && [jdk1.3.1](03)/[jdk1.4](fcs) Resolved for 3.4.x or earlier, no new info since then -> closing. |