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 83595 - JarDataObject eagerly open the jar file
Summary: JarDataObject eagerly open the jar file
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2006-08-28 14:15 UTC by Petr Nejedly
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

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 Petr Nejedly 2006-08-28 14:15:27 UTC
J have many jars/zips randomly placed in my $HOME (bad habit of not setting
FireFox's download dir). Some of them are even corrupted.
The IDE chokes on them randomly, e.g. because of the favorites view, so I traced
the opening of them (beyond the scheduled refresh in RP). Here it goes:

org.netbeans.core.startup.layers.ArchiveURLMapper.getFileObjects(ArchiveURLMapper.java:110)
org.openide.filesystems.URLMapper.findFileObject(URLMapper.java:188)
org.openide.filesystems.FileUtil.getArchiveRoot(FileUtil.java:1226)
org.netbeans.modules.java.jarloader.JarDataNode.childrenFor(JarDataNode.java:50)
org.netbeans.modules.java.jarloader.JarDataNode.<init>(JarDataNode.java:37)
org.netbeans.modules.java.jarloader.JarDataObject.createNodeDelegate(JarDataObject.java:43)
org.openide.loaders.DataObject$1.run(DataObject.java:253)
org.openide.util.Mutex.readAccess(Mutex.java:293)
org.openide.loaders.DataObject.getNodeDelegate(DataObject.java:249)
org.openide.loaders.DataObject.getClonedNodeDelegate(DataObject.java:274)
org.openide.loaders.FolderChildren.createNodes(FolderChildren.java:143)

Basically, JarDataNode opens the Jar file immediatelly in its ctor, which is
very unpolite. Imagine I had many, maybe large .zip files in some folder, they'd
all get opened as soon as I merely browse into the folder.
Comment 1 Petr Nejedly 2006-08-28 14:17:03 UTC
Note: Even commit validation fails for me because of such files in my $HOME,
which is pretty bad.
Comment 2 Jan Pokorsky 2006-08-28 14:42:34 UTC
That's true, it is not much wise. I will fix it. However I have not idea how it
relates to commit validation tests.
Comment 3 Petr Nejedly 2006-08-28 15:52:00 UTC
> However I have not idea how it relates to commit validation tests.

It's just a coincidence that during testModuleInstallation, there is a refresh
performed and during that refresh, exception is logged:
org.openide.filesystems.FSException: Error in JAR file /space/nenik/broken.zip:
invalid CEN header (bad signature)
 at org.openide.filesystems.FSException.io(FSException.java:88)
 at org.openide.filesystems.JarFileSystem.setJarFile(JarFileSystem.java:246)

and the infrastructure probably considers any logged exception during that test
as a showstopper.
Comment 4 Jan Pokorsky 2006-08-31 14:13:07 UTC
fixed in

/cvs/java/src/org/netbeans/modules/java/jarloader/JarDataNode.java,v  <-- 
JarDataNode.java
new revision: 1.3; previous revision: 1.2