public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch: FYI: PR 21637 fixlet
@ 2006-01-09 20:06 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2006-01-09 20:06 UTC (permalink / raw)
  To: Java Patch List

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-01-09 20:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-09 20:06 Patch: FYI: PR 21637 fixlet Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).