[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: jar connection fix from Mark
Kaffe CVS
cvs-commits at kaffe.org
Thu Feb 3 09:19:34 PST 2005
PatchSet 5968
Date: 2005/02/03 17:14:35
Author: robilad
Branch: HEAD
Tag: (none)
Log:
Resynced with GNU Classpath: jar connection fix from Mark
2005-02-03 Dalibor Topic <robilad at kaffe.org>
Resynced with GNU Classpath.
2005-02-02 Mark Wielaard <mark at klomp.org>
* gnu/java/net/protocol/jar/Connection.java (is_trying): Removed
field.
(get): Don't use or set is_trying.
Members:
ChangeLog:1.3507->1.3508
libraries/javalib/gnu/java/net/protocol/jar/Connection.java:1.5->1.6
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3507 kaffe/ChangeLog:1.3508
--- kaffe/ChangeLog:1.3507 Thu Feb 3 17:09:13 2005
+++ kaffe/ChangeLog Thu Feb 3 17:14:35 2005
@@ -2,6 +2,16 @@
Resynced with GNU Classpath.
+ 2005-02-02 Mark Wielaard <mark at klomp.org>
+
+ * gnu/java/net/protocol/jar/Connection.java (is_trying): Removed
+ field.
+ (get): Don't use or set is_trying.
+
+2005-02-03 Dalibor Topic <robilad at kaffe.org>
+
+ Resynced with GNU Classpath.
+
2005-02-02 Robert Schuster <thebohemian at gmx.net>
* gnu/java/beans/decoder/GrowableArrayContext.java: Fixed
Index: kaffe/libraries/javalib/gnu/java/net/protocol/jar/Connection.java
diff -u kaffe/libraries/javalib/gnu/java/net/protocol/jar/Connection.java:1.5 kaffe/libraries/javalib/gnu/java/net/protocol/jar/Connection.java:1.6
--- kaffe/libraries/javalib/gnu/java/net/protocol/jar/Connection.java:1.5 Mon Jul 26 21:13:52 2004
+++ kaffe/libraries/javalib/gnu/java/net/protocol/jar/Connection.java Thu Feb 3 17:14:39 2005
@@ -1,5 +1,5 @@
/* Connection - jar url connection for java.net
- Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -68,7 +68,6 @@
{
private static Hashtable cache = new Hashtable();
private static final int READBUFSIZE = 4*1024;
- private static boolean is_trying = false;
public static synchronized JarFile get (URL url) throws IOException
{
@@ -77,45 +76,33 @@
if (jf != null)
return jf;
- if (is_trying)
- return null;
-
- try
- {
- is_trying = true;
-
- if ("file".equals (url.getProtocol()))
- {
- File f = new File (url.getFile());
- jf = new JarFile (f, true, ZipFile.OPEN_READ);
- }
- else
- {
- URLConnection urlconn = url.openConnection();
- InputStream is = urlconn.getInputStream();
- byte[] buf = new byte [READBUFSIZE];
- File f = File.createTempFile ("cache", "jar");
- FileOutputStream fos = new FileOutputStream (f);
- int len = 0;
-
- while ((len = is.read (buf)) != -1)
- {
- fos.write (buf, 0, len);
- }
-
- fos.close();
- // 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);
- jf = new JarFile (f, true, ZipFile.OPEN_READ);
- }
+ if ("file".equals (url.getProtocol()))
+ {
+ File f = new File (url.getFile());
+ jf = new JarFile (f, true, ZipFile.OPEN_READ);
+ }
+ else
+ {
+ URLConnection urlconn = url.openConnection();
+ InputStream is = urlconn.getInputStream();
+ byte[] buf = new byte [READBUFSIZE];
+ File f = File.createTempFile ("cache", "jar");
+ FileOutputStream fos = new FileOutputStream (f);
+ int len = 0;
+
+ while ((len = is.read (buf)) != -1)
+ {
+ fos.write (buf, 0, len);
+ }
+
+ fos.close();
+ // 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);
+ jf = new JarFile (f, true, ZipFile.OPEN_READ);
+ }
- cache.put (url, jf);
- }
- finally
- {
- is_trying = false;
- }
+ cache.put (url, jf);
return jf;
}
More information about the kaffe
mailing list