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.
Since we switched Utililites.toURI(file) to file.toPath().toUri() the org.bootstrap.ProxyURLStreamHandlerFactoryTest.testUNCFileURLStreamHandler is failing. I can fix the test, but I don't know if that is what should be done. CCing Jesse and Jirka. Both touched the test and related URI conversion infrastructure.
The failures: http://test4u.cz.oracle.com/view/Platform/job/PlatformBootstrap-trunk/lastCompletedBuild/jdk=jdk7,label=win7/testReport/org.netbeans/ProxyURLStreamHandlerFactoryTest/testUNCFileURLStreamHandler/
Please review: http://hg.netbeans.org/ergonomics/rev/03f653d52e6c
Looks right to me. Not sure why this test was here rather than in UtilitiesTest.
I am far from filesystems for a long time but URI "file://computerName/sharedFolder/a/b/c/d.txt" does not seem correct to me. The following fails: new File(URI.create("file://computerName/sharedFolder/a/b/c/d.txt")); java.lang.IllegalArgumentException: URI has an authority component at java.io.File.<init>(File.java:423) ---- Comment above test reads: /** Tests UNC path is correctly treated. On JDK1.5 UNCFileStreamHandler should * be installed in ProxyURLStreamHandlerFactory to workaround JDK bug * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5086147. */ I really don't remember all consequences but UNCFileStreamHandler class seems to be gone, so it is possible to move the test to UtilitiesTest.
(In reply to Jiri Skrivanek from comment #4) > The following fails: > > new File(URI.create("file://computerName/sharedFolder/a/b/c/d.txt")); Because this call is known to be broken. You have to use Paths.get(URI) in JDK 7, or Utilities.toFile(URI) which works also in JDK 6. (Did I hear that the NB source code is now JDK 7+ only? Then Utilities.toFile and a bunch of related code can be simplified to use java.nio.file unconditionally and not bother with JDK 6 fallbacks.)
Tried in http://hg.netbeans.org/main-golden/rev/4825da0a3d8f but it had glitches, so current state is: http://hg.netbeans.org/main-golden/file/d473cd33358e/openide.util/src/org/openide/util/Utilities.java#l3146
OK, Jesse explained that the current behavior is correct. Closing again.