This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgcj/21637] New: URL.openStream doesn't throw a FileNotFoundException with some urls
- From: "bkonrath at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 May 2005 22:43:08 -0000
- Subject: [Bug libgcj/21637] New: URL.openStream doesn't throw a FileNotFoundException with some urls
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Version:
gcc-java-4.0.0-5 from FC4 rawhide
Test Case:
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
public class URLTest {
public static void main(String[] args) throws IOException {
// replace this with any jar on your system
// that doesn't have /blah.txt in it.
String jar = "/path/to/jar/bork.jar";
URL url = new URL("jar:file:" + jar + "!/blah.txt");
InputStream is = url.openStream();
System.out.println("InputStream: " + is);
}
}
Result of running with gij:
InputStream: null
Result of running with Sun's VM:
Exception in thread "main" java.io.FileNotFoundException: JAR entry blah.txt not
found in /usr/share/eclipse/plugins/org.eclipse.osgi_3.1.0.jar
at
sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:97)
at
sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:107)
at java.net.URL.openStream(URL.java:913)
at URLTest.main(URLTest.java:12)
--
Summary: URL.openStream doesn't throw a FileNotFoundException
with some urls
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bkonrath at redhat dot com
CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21637