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.
I modified my $userdir/config/Services/Platforms/org-netbeans-api-java-Platform/.default.xml to read: .... <sources> <resource>jar:file:/space/jdk1.5/src.zip!/</resource> <resource>jar:file:/space/src/jdk150b51-solwin-src.zip!/j2se/src/share/classes/</resource> <resource>jar:file:/space/src/jdk150b51-solwin-src.zip!/j2se/src/solaris/classes/</resource> <resource>jar:file:/space/src/jdk150b51-solwin-src.zip!/j2se/src/windows/classes/</resource> </sources> .... Here I have full JDK sources in a ZIP file. But it doesn't seem to work from the editor side. When I reopened the IDE after making this change (no GUI support currently), Tools -> CCDBM showed an entry "/space/....-src.zip" which it scanned for a long time and finally reported "Warning: no parsable sources". Alt-G, Alt-Shift-O, etc. are not working on classes not in src.zip. And $userdir/config/ParserDB/jdk150b51-solwin-src-zip.jc? are empty (4 bytes each). So something is mishandling the jar: URL and assuming that the suffix after "!/" is empty when it is not. Haven't tried in a refactoring build - will assume the code in question is rewritten there, so just leave open until the refactoring merge and reevaluate.
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