This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: PR 21637 fixlet


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]