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.
[nb_dev](200409071800), [jdk1.5.0](rc) If you open New File wizard, AssertionError is logged to console : Exception in thread "Default RequestProcessor" java.lang.AssertionError: Should have found an EXTERNAL URL matching MultiFileObject@1062d8b[nbfs://nbhost/SystemFileSystem/Templates/Classes/] at org.netbeans.spi.java.classpath.support.ClassPathSupport.createClassPath(ClassPathSupport.java:103) at org.netbeans.modules.java.j2seplatform.platformdefinition.DefaultClassPathProvider.findClassPath(DefaultClassPathProvider.java:117) at org.netbeans.api.java.classpath.ClassPath.getClassPath(ClassPath.java:396) at org.netbeans.modules.javacore.JMManager.getResource(JMManager.java:416) at org.netbeans.modules.javacore.JMManager.getResource(JMManager.java:401) at org.netbeans.modules.java.bridge.SrcElementImpl.getDelegate(SrcElementImpl.java:72) at org.netbeans.modules.java.bridge.SrcElementImpl.addPropertyChangeListener(SrcElementImpl.java:283) at org.openide.src.Element.addPropertyChangeListener(Element.java:62) at org.netbeans.modules.java.JavaParserGlue.<init>(JavaParserGlue.java:102) at org.netbeans.modules.java.JavaDataObject.initializeParsingSupport(JavaDataObject.java:191) at org.netbeans.modules.java.JavaDataObject.createCookie(JavaDataObject.java:841) at org.openide.nodes.CookieSet$CookieEntry.getCookie(CookieSet.java:335) at org.openide.nodes.CookieSet.getCookie(CookieSet.java:93) at org.openide.loaders.MultiDataObject.getCookie(MultiDataObject.java:687) at org.netbeans.modules.java.JavaDataObject.getCookie(JavaDataObject.java:816) at org.netbeans.modules.java.JavaNode$4.run(JavaNode.java:770) at org.openide.util.Task.run(Task.java:136) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:686)
This regression was caused by this commit. Pavle, can you fix it? Modified: src/org/netbeans/modules/java JavaNode.java Log: #48548: First opening java file performance improved. Revision Changes Path 1.118 +2 -0 java/src/org/netbeans/modules/java/JavaNode.java
*** Issue 48615 has been marked as a duplicate of this issue. ***
IMHO this is a bug in ClassPathSupport. It should not reject internal URLs; there is nothing in the Classpath API that specifically forbids internal URLs. Just use FileObject.getURL and use the result, whatever it is. Some other code in the IDE (i.e. javacore) will presumably need to be made more robust than it probably is now - will need to explicitly check the incoming URLs it receives, and just pass over URLs which it cannot handle (i.e. which are not file: or jar:file: URLs).
The code in JavaNode which is on stack was removed in revision 1.121, reassigning back to evaluate problem which Jesse described.
Checking in src/org/netbeans/spi/java/classpath/support/ClassPathSupport.java; /cvs/java/api/src/org/netbeans/spi/java/classpath/support/ClassPathSupport.java,v <-- ClassPathSupport.java new revision: 1.7; previous revision: 1.6 done
Tomas: What effect will a nbfs URL now have on FileScanner when it tries to do new File(URI)? It will throw an IllegalArgumentException in its constructor (which BTW it does not declare - bad!); who catches that and how is it handled?
Thanks Jesse, this is my mistake. I've forgot to commit javacore module, where I do test that url is either file or jar with file. I am going to commit it.
verified in NB4.1