This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: PR 21637 fixlet
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 09 Jan 2006 13:01:50 -0700
- Subject: Patch: FYI: PR 21637 fixlet
- Reply-to: tromey at redhat dot com
I'm checking this in on the 4.1 branch.
I never really fixed PR 21637 the way I wanted, so I'm pulling forward
the fix from 4.0 so that we don't regress here.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
PR libgcj/21637:
* gnu/java/net/protocol/jar/Connection.java (getInputStream):
Throw FileNotFoundException if jar entry not found.
Index: gnu/java/net/protocol/jar/Connection.java
===================================================================
--- gnu/java/net/protocol/jar/Connection.java (revision 109497)
+++ gnu/java/net/protocol/jar/Connection.java (working copy)
@@ -41,9 +41,10 @@
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.File;
+import java.io.FileNotFoundException;
import java.io.FileOutputStream;
+import java.io.InputStream;
import java.io.IOException;
-import java.io.InputStream;
import java.net.JarURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
@@ -156,8 +157,6 @@
if (entry != null)
return jarfile.getInputStream (entry);
- else
- return null;
}
else
{
@@ -182,7 +181,10 @@
}
}
- return null;
+ throw new FileNotFoundException("No entry for \"" + getEntryName()
+ + "\" in \""
+ + getJarFileURL()
+ + "\"");
}
public synchronized JarFile getJarFile() throws IOException