harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r394935 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src: main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection.java test/java/tests/api/java/net/JarURLConnectionTest.java
Date Tue, 18 Apr 2006 13:10:45 GMT
Author: mloenko
Date: Tue Apr 18 06:10:43 2006
New Revision: 394935

URL: http://svn.apache.org/viewcvs?rev=394935&view=rev
Log:
refix for HARMONY-29 and regression test

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/JarURLConnectionTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection.java?rev=394935&r1=394934&r2=394935&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection.java
Tue Apr 18 06:10:43 2006
@@ -233,7 +233,7 @@
 			jar = (JarFile) entry.get();
 		if (jar == null && fileString != null) {
 			int flags = ZipFile.OPEN_READ + (temp ? ZipFile.OPEN_DELETE : 0);
-			jar = new JarFile(new File(Util.decode(fileString, true)), true, flags);
+			jar = new JarFile(new File(Util.decode(fileString, false)), true, flags);
 			jarCache.put(key, new CacheEntry(jar, key, cacheQueue));
 		} else {
 			SecurityManager security = System.getSecurityManager();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/JarURLConnectionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/JarURLConnectionTest.java?rev=394935&r1=394934&r2=394935&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/JarURLConnectionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/JarURLConnectionTest.java
Tue Apr 18 06:10:43 2006
@@ -16,11 +16,14 @@
 package tests.api.java.net;
 
 import java.io.File;
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.net.JarURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLConnection;
+import java.util.jar.JarOutputStream;
+import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
 import tests.support.resource.Support_Resources;
@@ -144,6 +147,23 @@
 			fail("Unexpected exception : " + e.getMessage());
 		}
 	}
+
+	/**
+	 * @tests java.net.JarURLConnection.getJarFile()
+         * 
+         * Regression test for HARMONY-29
+	 */
+	public void test_getJarFile29() throws Exception {
+                File jarFile = File.createTempFile("1+2 3", "test.jar");
+                jarFile.deleteOnExit();
+                JarOutputStream out = new JarOutputStream(new FileOutputStream(jarFile));
+                out.putNextEntry(new ZipEntry("test"));
+                out.closeEntry();
+                out.close();
+
+                JarURLConnection conn = (JarURLConnection) new URL("jar:file:/"+jarFile.getAbsolutePath().replaceAll("
", "%20")+"!/").openConnection();
+                conn.getJarFile().entries();
+        }
 
 	/**
 	 * @tests java.net.JarURLConnection#getJarFileURL()



Mime
View raw message