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: | Scanning of explicitly named subfolders of JARs does not work | ||
---|---|---|---|
Product: | java | Reporter: | Jesse Glick <jglick> |
Component: | Unsupported | Assignee: | Tomas Zezula <tzezula> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | dkonecny, tzezula |
Priority: | P2 | ||
Version: | 4.x | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | 42068 | ||
Bug Blocks: | 41448, 44840, 46455 |
Description
Jesse Glick
2004-05-19 17:54:40 UTC
To my surprice this case is really not supported - relative path in jar is simply ignored! It should not be that difficult to fix, but it is in code obsoleted by MDR. The workaround is to unzip sources and then in UI modify source path of JDK. Adding dependency on #42068. I am closing it... meta_stavbicka was merged to maintrunk. The merge fixes the problem, please verify. Doesn't seem to be working for me in 040615; I have the same platform config XML file as before, and just uncommented the lines using relative JAR paths. Don't see any evidence that it worked; at least, I cannot open e.g. sun.misc.URLClassPath using Fast Open or Go To Source (from URLClassLoader). Not familiar enough with the details of the MDR storage now to know whether it is storing it, but I did not see any scanning of these sources at startup time. But then I restart the IDE and now it works. Odd. But then sometimes after a restart it doesn't work. No clear pattern, but not working reliably. Since parserDBs were removed, I assume this could be MDR scanning problem. Reassigning... Maybe. Could also be a library parsing problem, etc. I am really not sure. Assigning to thurka. Still broken. For JDK 1.3.1 I use <sources> <resource>jar:file:/space/jdk1.3/src.jar!/src/</resource> </sources> In the scanning dialog (if I start the IDE with an empty cache) I see e.g. Scanning: ...//src Package: src.javax.swing The FileScanner class is clearly wrong. Its constructor has public FileScanner(File _root, String sourceLevel, Codebase cb) {...} which cannot work for JAR entries, and later it says if (name.endsWith(".jar") || name.endsWith(".zip")) { zipFile=true; } And JMManager is wrong: URL url = root.getURL(); if (url.getProtocol().equals("jar")) { url = FileUtil.getArchiveFile(url); } // ... URI rootUri = new URI(url.toExternalForm()); new FileScanner(new File(rootUri),sourceLevel,cb).scan(); Instead, this should be new FileScanner(root.getURL(), sourceLevel, cb).scan(); and FileScanner should do what it needs to do. ZipArchiveInfo should accept a second parameter for a JAR entry prefix. *** Issue 46468 has been marked as a duplicate of this issue. *** I think this bug is pretty serious. Prevents use of code completion against JDK 1.3. Maybe also affects all Mac OS X users? Anyway the fix should be pretty simple as far as I can see. This is not so easy as Jesse explained, but I will try to fix it. Thanks Tomas! Checking in javacore/src/org/netbeans/modules/javacore/JMManager.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/JMManager.java,v <-- JMManager.java new revision: 1.70; previous revision: 1.69 done Processing log script arguments... More commits to come... Checking in javacore/src/org/netbeans/modules/javacore/scanning/FileScanner.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/scanning/FileScanner.java,v <-- FileScanner.java new revision: 1.12; previous revision: 1.11 done Checking in javacore/src/org/netbeans/modules/javacore/scanning/ZipArchiveInfo.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/scanning/ZipArchiveInfo.java,v <-- ZipArchiveInfo.java new revision: 1.3; previous revision: 1.2 done Checking in javacore/src/org/netbeans/modules/javacore/scanning/ZipDirInfo.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/scanning/ZipDirInfo.java,v <-- ZipDirInfo.java new revision: 1.2; previous revision: 1.1 done Checking in javacore/src/org/netbeans/modules/javacore/scanning/ZipEntryInfo.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/scanning/ZipEntryInfo.java,v <-- ZipEntryInfo.java new revision: 1.2; previous revision: 1.1 done Reorganization of java component |