harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lian...@apache.org
Subject svn commit: r504807 - /harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarExecTest.java
Date Thu, 08 Feb 2007 07:11:55 GMT
Author: liangyx
Date: Wed Feb  7 23:11:54 2007
New Revision: 504807

URL: http://svn.apache.org/viewvc?view=rev&rev=504807
Log:
Fix HARMONY-1671 by specifying the charset as iso-8859-1 when decoding and encoding java class
file

Modified:
    harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarExecTest.java

Modified: harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarExecTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarExecTest.java?view=diff&rev=504807&r1=504806&r2=504807
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarExecTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarExecTest.java
Wed Feb  7 23:11:54 2007
@@ -196,13 +196,13 @@
 
 		JarOutputStream joutBoo = new JarOutputStream(new FileOutputStream(booJar));
 		joutBoo.putNextEntry(new JarEntry("foo/bar/execjartest/Foo.class"));
-		String booBody = new String(getResource(resources, "hyts_Foo.ser"));
+		String booBody = new String(getResource(resources, "hyts_Foo.ser"), "iso-8859-1");
 		booBody = booBody.replaceFirst("FOO", "BOO");
-		joutBoo.write(booBody.getBytes());
+		joutBoo.write(booBody.getBytes("iso-8859-1"));
 		joutBoo.putNextEntry(new JarEntry("foo/bar/execjartest/Bar.class"));
-		String farBody = new String(getResource(resources, "hyts_Bar.ser"));
+		String farBody = new String(getResource(resources, "hyts_Bar.ser"), "iso-8859-1");
 		farBody = farBody.replaceFirst("BAR", "FAR");
-		joutBoo.write(farBody.getBytes());
+		joutBoo.write(farBody.getBytes("iso-8859-1"));
 		joutBoo.close();
 
 		res = Support_Exec.execJava(args, new String[] {booJar.getAbsolutePath()}, new String[]
{ "CLASSPATH=" + fooJar.getAbsolutePath() }, false);
@@ -221,13 +221,13 @@
 
 		JarOutputStream joutZoo = new JarOutputStream(new FileOutputStream(zooJar), man);
 		joutZoo.putNextEntry(new JarEntry("foo/bar/execjartest/Foo.class"));
-		String zooBody = new String(getResource(resources, "hyts_Foo.ser"));
+		String zooBody = new String(getResource(resources, "hyts_Foo.ser"), "iso-8859-1");
 		zooBody = zooBody.replaceFirst("FOO", "ZOO");
-		joutZoo.write(zooBody.getBytes());
+		joutZoo.write(zooBody.getBytes("iso-8859-1"));
 		joutZoo.putNextEntry(new JarEntry("foo/bar/execjartest/Bar.class"));
-		String zarBody = new String(getResource(resources, "hyts_Bar.ser"));
+		String zarBody = new String(getResource(resources, "hyts_Bar.ser"), "iso-8859-1");
 		zarBody = zarBody.replaceFirst("BAR", "ZAR");
-		joutZoo.write(zarBody.getBytes());
+		joutZoo.write(zarBody.getBytes("iso-8859-1"));
 		joutZoo.close();
 
 		args = new String[] {"-jar", zooJar.getAbsolutePath()};



Mime
View raw message