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]

FYI: Patch: gnu.java.net.protocol.jar.Connection


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I commited the attached patch which gets 
gnu.java.net.protocol.jar.Connection more in line with classpath.


Michael
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/zK7/WSOgCCdjSDsRAoYiAJ42RMWcF8mTO17sqipT+UIQGj43wACbBMxI
MtfkNPtHNnTfzAlcdwz/v/s=
=lJX3
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2397
diff -u -b -B -r1.2397 ChangeLog
--- ChangeLog	2 Dec 2003 14:13:44 -0000	1.2397
+++ ChangeLog	2 Dec 2003 14:19:10 -0000
@@ -1,5 +1,12 @@
 2003-12-02  Michael Koch  <konqueror@gmx.de>
 
+	* gnu/java/net/protocol/jar/Connection.java
+	(Connection): Made class final, merged documentation with classpath.
+	(file_cache): Made private.
+	(jar_file): Renamed from jarfile.
+
+2003-12-02  Michael Koch  <konqueror@gmx.de>
+
 	* gnu/java/net/protocol/http/Connection.java
 	(Connection): Initialize doOutput to false;
 	(connect): Initialize inputStream, moved "send request" code to new
Index: gnu/java/net/protocol/jar/Connection.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/net/protocol/jar/Connection.java,v
retrieving revision 1.2
diff -u -b -B -r1.2 Connection.java
--- gnu/java/net/protocol/jar/Connection.java	18 Oct 2003 12:24:57 -0000	1.2
+++ gnu/java/net/protocol/jar/Connection.java	2 Dec 2003 14:19:10 -0000
@@ -47,29 +47,28 @@
 import java.net.ProtocolException;
 import java.net.URL;
 import java.net.URLConnection;
-import java.net.URLStreamHandler;
 import java.util.Hashtable;
 import java.util.jar.JarFile;
 import java.util.zip.ZipFile;
 
 /**
- * Written using on-line Java Platform 1.2 API Specification.
+ * This subclass of java.net.JarURLConnection models a URLConnection via
+ * the "jar" protocol.
  *
  * @author Kresten Krab Thorup <krab@gnu.org>
- * @date Aug 10, 1999.
  */
-public class Connection extends JarURLConnection
+public final class Connection extends JarURLConnection
 {
-  static Hashtable file_cache = new Hashtable();
-  private JarFile jarfile;
+  private static Hashtable file_cache = new Hashtable();
+  private JarFile jar_file;
 
-  public Connection(URL url)
+  protected Connection(URL url)
     throws MalformedURLException
   {
     super(url);
   }
 
-  public synchronized JarFile getJarFile() throws java.io.IOException
+  public synchronized JarFile getJarFile() throws IOException
   {
     if (!connected)
       connect();
@@ -77,8 +76,8 @@
     if (! doInput)
       throw new ProtocolException("Can't open JarFile if doInput is false");
 
-    if (jarfile != null)
-      return jarfile;
+    if (jar_file != null)
+      return jar_file;
 
     URL jarFileURL = getJarFileURL();
 
@@ -87,15 +86,15 @@
       {
 	if (getUseCaches())
 	  {
-	    jarfile = (JarFile) file_cache.get(jarFileURL);
-	    if (jarfile == null)
+	    jar_file = (JarFile) file_cache.get (jarFileURL);
+	    if (jar_file == null)
 	      {
-		jarfile = new JarFile (jarFileURL.getFile());
-		file_cache.put (jarFileURL, jarfile);
+		jar_file = new JarFile (jarFileURL.getFile());
+		file_cache.put (jarFileURL, jar_file);
 	      }
 	  }
 	else
-	  jarfile = new JarFile (jarFileURL.getFile());
+	  jar_file = new JarFile (jarFileURL.getFile());
       }
     else
       {
@@ -111,10 +110,10 @@
 	// Always verify the Manifest, open read only and delete when done.
 	// XXX ZipFile.OPEN_DELETE not yet implemented.
 	// jf = new JarFile(f, true, ZipFile.OPEN_READ | ZipFile.OPEN_DELETE);
-	jarfile = new JarFile(f, true, ZipFile.OPEN_READ);
+	jar_file = new JarFile (f, true, ZipFile.OPEN_READ);
       }
 
-    return jarfile;
+    return jar_file;
   }
 
 }

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