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.
Some tests from o.n.bootstrap and core.startup fail on space in path. Following modification to 2ec9db219998 makes the test fail: diff -r 2ec9db219998 o.n.bootstrap/test/unit/src/org/netbeans/URLsAreEqualTest.java --- a/o.n.bootstrap/test/unit/src/org/netbeans/URLsAreEqualTest.java Sat Apr 23 17:28:21 2011 +0200 +++ b/o.n.bootstrap/test/unit/src/org/netbeans/URLsAreEqualTest.java Sun Apr 24 07:55:47 2011 +0200 @@ -64,7 +64,10 @@ } public void testURLsAreEqual() throws Exception { - File jar = new File(getWorkDir(), "default-package-resource.jar"); + final File wd = new File(getWorkDir(), "work dir"); + wd.mkdirs(); + + File jar = new File(wd, "default-package-resource.jar"); URL orig = new URL("jar:" + jar.toURI() + "!/package/resource.txt"); URLConnection conn = orig.openConnection();
ergonomics#baccf434c55d
Integrated into 'main-golden', will be available in build *201104260000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/baccf434c55d User: Jaroslav Tulach <jtulach@netbeans.org> Log: #198039: Convert '%20' to ' '
This does not look like a complete fix; you are only handling the special case of "%20", not other escapable characters. Demonstration: diff --git a/o.n.bootstrap/test/unit/src/org/netbeans/URLsAreEqualTest.java b/o.n.bootstrap/test/unit/src/org/netbeans/URLsAreEqualTest.java --- a/o.n.bootstrap/test/unit/src/org/netbeans/URLsAreEqualTest.java +++ b/o.n.bootstrap/test/unit/src/org/netbeans/URLsAreEqualTest.java @@ -64,7 +64,7 @@ } public void testURLsAreEqual() throws Exception { - final File wd = new File(getWorkDir(), "work dir"); + final File wd = new File(getWorkDir(), "work dir #1"); wd.mkdirs(); File jar = new File(wd, "default-package-resource.jar"); The following would work except possibly on UNC paths: diff --git a/o.n.bootstrap/src/org/netbeans/JarClassLoader.java b/o.n.bootstrap/src/org/netbeans/JarClassLoader.java --- a/o.n.bootstrap/src/org/netbeans/JarClassLoader.java +++ b/o.n.bootstrap/src/org/netbeans/JarClassLoader.java @@ -87,7 +87,6 @@ import java.util.logging.Logger; import java.util.zip.ZipEntry; import java.util.zip.ZipException; -import org.openide.util.Utilities; /** * A ProxyClassLoader capable of loading classes from a set of jar files @@ -848,14 +847,12 @@ if (bang == -1) { throw new IOException("Malformed JAR-protocol URL: " + u); } - int from; - if (url.startsWith("file:")) { - from = Utilities.isWindows() ? 6 : 5; - } else { - from = 0; + String jar; + try { + jar = new File(new URI(url.substring(0, bang))).getAbsolutePath(); + } catch (URISyntaxException x) { + throw new IOException(x); } - String jar = url.substring(from, bang).replace('/', File.separatorChar) - .replace("%20", " "); Source _src = Source.sources.get(jar); LOGGER.log(Level.FINER, "openConnection for {0} jar: {1} src: {2}", new Object[]{u, jar, _src}); if (_src == null) { Anyway this is not even a partial fix of bug #195730, which is about something different (handling of Class-Path headers).
Thanks Jesse: ergonomics#0928450a313b
Integrated into 'main-golden', will be available in build *201105030000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/0928450a313b User: Jaroslav Tulach <jtulach@netbeans.org> Log: #198039: Using URI to convert to File name. Thanks Jesse.