harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r449886 [2/2] - in /incubator/harmony/enhanced/classlib/trunk/modules/archive/src: main/java/java/util/jar/ main/java/java/util/zip/ main/java/org/apache/harmony/archive/internal/pack200/ test/java/org/apache/harmony/archive/tests/internal/...
Date Tue, 26 Sep 2006 03:02:54 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java Mon Sep 25 20:02:49 2006
@@ -30,33 +30,30 @@
 import java.util.jar.Manifest;
 import java.util.zip.ZipEntry;
 
+import junit.framework.TestCase;
 import tests.support.Support_PlatformFile;
 import tests.support.resource.Support_Resources;
 
-public class JarFileTest extends junit.framework.TestCase {
+public class JarFileTest extends TestCase {
 
-	java.util.zip.ZipEntry zipEntry;
+	private final String jarName = "hyts_patch.jar"; // a 'normal' jar file
 
-	java.util.jar.JarEntry jarEntry;
+    private final String jarName2 = "hyts_patch2.jar"; 
 
-	java.util.jar.JarFile jarFile;
+    private final String jarName3 = "hyts_manifest1.jar";
 
-	final String jarName = "hyts_patch.jar"; // a 'normal' jar file
+    private final String jarName4 = "hyts_signed.jar";
 
-	// same as patch.jar but without a manifest file
-	final String jarName2 = "hyts_patch2.jar"; 
+    private final String entryName = "foo/bar/A.class";
 
-	final String jarName3 = "hyts_manifest1.jar";
+    private final String entryName3 = "coucou/FileAccess.class";
 
-	final String jarName4 = "hyts_signed.jar";
-
-	final String entryName = "foo/bar/A.class";
-
-	final String entryName2 = "Blah.txt";
-
-	final String entryName3 = "coucou/FileAccess.class";
-
-	File resources;
+    private File resources;
+    
+    @Override
+    protected void setUp() {
+        resources = Support_Resources.createTempFolder();
+    }
 
 	/**
 	 * @tests java.util.jar.JarFile#JarFile(java.io.File)
@@ -98,7 +95,7 @@
 		try {
 			Support_Resources.copyFile(resources, null, jarName);
 			JarFile jarFile = new JarFile(new File(resources, jarName));
-			Enumeration e = jarFile.entries();
+			Enumeration<JarEntry> e = jarFile.entries();
 			int i = 0;
 			while (e.hasMoreElements()) {
 				i++;
@@ -113,7 +110,7 @@
 		try {
 			Support_Resources.copyFile(resources, null, jarName);
 			JarFile jarFile = new JarFile(new File(resources, jarName));
-			Enumeration enumeration = jarFile.entries();
+			Enumeration<JarEntry> enumeration = jarFile.entries();
 			jarFile.close();
 			boolean pass = false;
 			try {
@@ -158,7 +155,7 @@
 		// test all signed jars in the /Testres/Internal/SignedJars directory
 		String jarDirUrl = Support_Resources
 				.getResourceURL("/../internalres/signedjars");
-		Vector signedJars = new Vector();
+		Vector<String> signedJars = new Vector<String>();
 		try {
 			InputStream is = new URL(jarDirUrl + "/jarlist.txt").openStream();
 			while (is.available() > 0) {
@@ -195,15 +192,15 @@
 		}
 
 		for (int i = 0; i < signedJars.size(); i++) {
-			String jarName = (String) signedJars.get(i);
+			String jarName = signedJars.get(i);
 			try {
 				File file = Support_Resources.getExternalLocalFile(jarDirUrl
 						+ "/" + jarName);
 				JarFile jarFile = new JarFile(file, true);
 				boolean foundCerts = false;
-				Enumeration e = jarFile.entries();
+				Enumeration<JarEntry> e = jarFile.entries();
 				while (e.hasMoreElements()) {
-					JarEntry entry = (JarEntry) e.nextElement();
+					JarEntry entry = e.nextElement();
 					InputStream is = jarFile.getInputStream(entry);
 					is.skip(100000);
 					is.close();
@@ -398,9 +395,9 @@
         Support_Resources.copyFile(resources, null, modifiedJarName);
         JarFile jarFile = new JarFile(new File(resources, modifiedJarName),
                 true);
-        Enumeration entries = jarFile.entries();
+        Enumeration<JarEntry> entries = jarFile.entries();
         while (entries.hasMoreElements()) {
-            ZipEntry zipEntry = (ZipEntry) entries.nextElement();
+            ZipEntry zipEntry = entries.nextElement();
             jarFile.getInputStream(zipEntry);
         }
     }
@@ -411,9 +408,9 @@
         Support_Resources.copyFile(resources, null, modifiedJarName);
         JarFile jarFile = new JarFile(new File(resources, modifiedJarName),
                 true);
-        Enumeration entries = jarFile.entries();
+        Enumeration<JarEntry> entries = jarFile.entries();
         while (entries.hasMoreElements()) {
-            ZipEntry zipEntry = (ZipEntry) entries.nextElement();
+            ZipEntry zipEntry = entries.nextElement();
             jarFile.getInputStream(zipEntry);
         }
     }
@@ -427,11 +424,11 @@
         Support_Resources.copyFile(resources, null, modifiedJarName);
         JarFile jarFile = new JarFile(new File(resources, modifiedJarName),
                 true);
-        Enumeration entries = jarFile.entries();
+        Enumeration<JarEntry> entries = jarFile.entries();
         int count = 0;
         while (entries.hasMoreElements()) {
 
-            ZipEntry zipEntry = (ZipEntry) entries.nextElement();
+            ZipEntry zipEntry = entries.nextElement();
             jarFile.getInputStream(zipEntry);
             count++;
         }
@@ -448,11 +445,11 @@
         Support_Resources.copyFile(resources, null, modifiedJarName);
         JarFile jarFile = new JarFile(new File(resources, modifiedJarName),
                 true);
-        Enumeration entries = jarFile.entries();
+        Enumeration<JarEntry> entries = jarFile.entries();
         int count = 0;
         while (entries.hasMoreElements()) {
 
-            ZipEntry zipEntry = (ZipEntry) entries.nextElement();
+            ZipEntry zipEntry = entries.nextElement();
             jarFile.getInputStream(zipEntry);
             count++;
         }
@@ -469,9 +466,9 @@
         Support_Resources.copyFile(resources, null, modifiedJarName);
         JarFile jarFile = new JarFile(new File(resources, modifiedJarName),
                 true);
-        Enumeration entries = jarFile.entries();
+        Enumeration<JarEntry> entries = jarFile.entries();
         while (entries.hasMoreElements()) {
-            ZipEntry zipEntry = (ZipEntry) entries.nextElement();
+            ZipEntry zipEntry = entries.nextElement();
             jarFile.getInputStream(zipEntry);
         }
         /* The content of Test.class has been tampered. */
@@ -499,9 +496,9 @@
         Support_Resources.copyFile(resources, null, modifiedJarName);
         JarFile jarFile = new JarFile(new File(resources, modifiedJarName),
                 true);
-        Enumeration entries = jarFile.entries();
+        Enumeration<JarEntry> entries = jarFile.entries();
         while (entries.hasMoreElements()) {
-            ZipEntry zipEntry = (ZipEntry) entries.nextElement();
+            ZipEntry zipEntry = entries.nextElement();
             try {
                 jarFile.getInputStream(zipEntry);
                 fail("should throw Security Excetpion");
@@ -522,9 +519,9 @@
         Support_Resources.copyFile(resources, null, modifiedJarName);
         JarFile jarFile = new JarFile(new File(resources, modifiedJarName),
                 true);
-        Enumeration entries = jarFile.entries();
+        Enumeration<JarEntry> entries = jarFile.entries();
         while (entries.hasMoreElements()) {
-            ZipEntry zipEntry = (ZipEntry) entries.nextElement();
+            ZipEntry zipEntry = entries.nextElement();
             try {
                 jarFile.getInputStream(zipEntry);
                 fail("should throw Security Excetpion");
@@ -543,9 +540,9 @@
         Support_Resources.copyFile(resources, null, modifiedJarName);
         JarFile jarFile = new JarFile(new File(resources, modifiedJarName),
                 true);
-        Enumeration entries = jarFile.entries();
+        Enumeration<JarEntry> entries = jarFile.entries();
         while (entries.hasMoreElements()) {
-            ZipEntry zipEntry = (ZipEntry) entries.nextElement();
+            ZipEntry zipEntry = entries.nextElement();
             try {
                 jarFile.getInputStream(zipEntry);
                 fail("should throw Security Excetpion");
@@ -554,21 +551,4 @@
             }
         }
     }
-    
-	/**
-	 * Sets up the fixture, for example, open a network connection. This method
-	 * is called before a test is executed.
-	 */
-	protected void setUp() {
-		resources = Support_Resources.createTempFolder();
-
-	}
-
-	/**
-	 * Tears down the fixture, for example, close a network connection. This
-	 * method is called after a test is executed.
-	 */
-	protected void tearDown() {
-	}
-
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarInputStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarInputStreamTest.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarInputStreamTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarInputStreamTest.java Mon Sep 25 20:02:49 2006
@@ -15,6 +15,7 @@
 package org.apache.harmony.archive.tests.java.util.jar;
 
 import java.io.IOException;
+import java.io.InputStream;
 import java.net.URL;
 import java.util.Arrays;
 import java.util.HashSet;
@@ -28,20 +29,24 @@
 
 public class JarInputStreamTest extends junit.framework.TestCase {
 	// a 'normal' jar file
-	String jarName;
+	private String jarName;
 
 	// same as patch.jar but without a manifest file
-	String jarName2;
+	private String jarName2;
 
-	final String entryName = "foo/bar/A.class";
+    private final String entryName = "foo/bar/A.class";
 
-	final String entryName2 = "Blah.txt";
+    private static final int indexofDSA = 2;
 
-    private static int indexofDSA = 2;
+    private static final int indexofTESTCLASS = 4;
 
-    private static int indexofTESTCLASS = 4;
-
-    private static int totalEntries = 4;
+    private static final int totalEntries = 4;
+    
+    @Override
+    protected void setUp() {
+        jarName = Support_Resources.getURL("morestuff/hyts_patch.jar");
+        jarName2 = Support_Resources.getURL("morestuff/hyts_patch2.jar");
+    }
 
 	/**
 	 * @tests java.util.jar.JarInputStream#JarInputStream(java.io.InputStream)
@@ -49,7 +54,7 @@
 	public void test_ConstructorLjava_io_InputStream() {
 		// Test for method java.util.jar.JarInputStream(java.io.InputStream)
 		try {
-			java.io.InputStream is = new URL(jarName).openConnection()
+			InputStream is = new URL(jarName).openConnection()
 					.getInputStream();
 			boolean hasCorrectEntry = false;
 			JarInputStream jis = new JarInputStream(is);
@@ -57,8 +62,9 @@
 					.getManifest());
 			JarEntry je = jis.getNextJarEntry();
 			while (je != null) {
-				if (je.getName().equals(entryName))
-					hasCorrectEntry = true;
+				if (je.getName().equals(entryName)) {
+                    hasCorrectEntry = true;
+                }
 				je = jis.getNextJarEntry();
 			}
 			assertTrue(
@@ -79,7 +85,7 @@
 		try {
 			Manifest m;
 
-			java.io.InputStream is = new URL(jarName2).openConnection()
+			InputStream is = new URL(jarName2).openConnection()
 					.getInputStream();
 			JarInputStream jis = new JarInputStream(is);
 			m = jis.getManifest();
@@ -102,11 +108,11 @@
 	public void test_getNextJarEntry() {
 		// Test for method java.util.jar.JarEntry
 		// java.util.jar.JarInputStream.getNextJarEntry()
-		final Set desired = new HashSet(Arrays.asList(new String[] { "foo/",
+		final Set<String> desired = new HashSet<String>(Arrays.asList(new String[] { "foo/",
 				"foo/bar/", "foo/bar/A.class", "Blah.txt" }));
-		Set actual = new HashSet();
+		Set<String> actual = new HashSet<String>();
 		try {
-			java.io.InputStream is = new URL(jarName).openConnection()
+			InputStream is = new URL(jarName).openConnection()
 					.getInputStream();
 			JarInputStream jis = new JarInputStream(is);
 			JarEntry je = jis.getNextJarEntry();
@@ -123,7 +129,7 @@
     public void test_JarInputStream_Integrate_Jar_getNextEntry()
             throws IOException {
         String intJarName = Support_Resources.getURL("Integrate.jar");
-        java.io.InputStream is = new URL(intJarName).openConnection()
+        InputStream is = new URL(intJarName).openConnection()
                 .getInputStream();
         JarInputStream jin = new JarInputStream(is, true);
         ZipEntry entry = null;
@@ -139,7 +145,7 @@
     public void test_JarInputStream_Modified_Class_getNextEntry()
             throws IOException {
         String modJarName = Support_Resources.getURL("Modified_Class.jar");
-        java.io.InputStream is = new URL(modJarName).openConnection()
+        InputStream is = new URL(modJarName).openConnection()
                 .getInputStream();
         JarInputStream jin = new JarInputStream(is, true);
         ZipEntry zipEntry = null;
@@ -149,11 +155,13 @@
             count++;
             try {
                 zipEntry = jin.getNextEntry();
-                if (count == indexofTESTCLASS + 1)
+                if (count == indexofTESTCLASS + 1) {
                     fail("Should throw Security Exception");
+                }
             } catch (SecurityException e) {
-                if (count != indexofTESTCLASS + 1)
+                if (count != indexofTESTCLASS + 1) {
                     throw e;
+                }
 
             }
         }
@@ -164,7 +172,7 @@
     public void test_JarInputStream_Modified_Manifest_MainAttributes_getNextEntry()
             throws IOException {
         String modJarName = Support_Resources.getURL("Modified_Manifest_MainAttributes.jar");
-        java.io.InputStream is = new URL(modJarName).openConnection()
+        InputStream is = new URL(modJarName).openConnection()
                 .getInputStream();
         JarInputStream jin = new JarInputStream(is, true);
         ZipEntry zipEntry = null;
@@ -176,11 +184,13 @@
             count++;
             try {
                 zipEntry = jin.getNextEntry();
-                if (count == indexofDSA + 1)
+                if (count == indexofDSA + 1) {
                     fail("Should throw Security Exception");
+                }
             } catch (SecurityException e) {
-                if (count != indexofDSA + 1)
+                if (count != indexofDSA + 1) {
                     throw e;
+                }
             }
         }
         assertEquals(totalEntries + 2, count);
@@ -191,7 +201,7 @@
             throws IOException {
         String modJarName = Support_Resources
                 .getURL("Modified_Manifest_EntryAttributes.jar");
-        java.io.InputStream is = new URL(modJarName).openConnection()
+        InputStream is = new URL(modJarName).openConnection()
                 .getInputStream();
         JarInputStream jin = new JarInputStream(is, true);
         ZipEntry zipEntry = null;
@@ -201,11 +211,13 @@
             count++;
             try {
                 zipEntry = jin.getNextEntry();
-                if (count == indexofDSA + 1)
+                if (count == indexofDSA + 1) {
                     fail("Should throw Security Exception");
+                }
             } catch (SecurityException e) {
-                if (count != indexofDSA + 1)
+                if (count != indexofDSA + 1) {
                     throw e;
+                }
             }
         }
         assertEquals(totalEntries + 2, count);
@@ -216,7 +228,7 @@
             throws IOException {
         String modJarName = Support_Resources
                 .getURL("Modified_SF_EntryAttributes.jar");
-        java.io.InputStream is = new URL(modJarName).openConnection()
+        InputStream is = new URL(modJarName).openConnection()
                 .getInputStream();
         JarInputStream jin = new JarInputStream(is, true);
         ZipEntry zipEntry = null;
@@ -226,11 +238,13 @@
             count++;
             try {
                 zipEntry = jin.getNextEntry();
-                if (count == indexofDSA + 1)
+                if (count == indexofDSA + 1) {
                     fail("Should throw Security Exception");
+                }
             } catch (SecurityException e) {
-                if (count != indexofDSA + 1)
+                if (count != indexofDSA + 1) {
                     throw e;
+                }
             }
         }
         assertEquals(totalEntries + 2, count);
@@ -239,7 +253,7 @@
 
     public void test_JarInputStream_Modified_Class_read() throws IOException {
         String modJarName = Support_Resources.getURL("Modified_Class.jar");
-        java.io.InputStream is = new URL(modJarName).openConnection()
+        InputStream is = new URL(modJarName).openConnection()
                 .getInputStream();
         JarInputStream jin = new JarInputStream(is, true);
         int count = 0;
@@ -253,11 +267,13 @@
                 while (length >= 0) {
                     length = jin.read(buffer);
                 }
-                if (count == indexofTESTCLASS)
+                if (count == indexofTESTCLASS) {
                     fail("Should throw Security Exception");
+                }
             } catch (SecurityException e) {
-                if (count < indexofTESTCLASS)
+                if (count < indexofTESTCLASS) {
                     throw e;
+                }
             }
         }
         assertEquals(totalEntries + 1, count);
@@ -266,7 +282,7 @@
 
     public void test_Integrate_Jar_read() throws IOException {
         String intJarName = Support_Resources.getURL("Integrate.jar");
-        java.io.InputStream is = new URL(intJarName).openConnection()
+        InputStream is = new URL(intJarName).openConnection()
                 .getInputStream();
         JarInputStream jin = new JarInputStream(is, true);
         int count = 0;
@@ -289,7 +305,7 @@
             throws IOException {
         String modJarName = Support_Resources
                 .getURL("Modified_Manifest_MainAttributes.jar");
-        java.io.InputStream is = new URL(modJarName).openConnection()
+        InputStream is = new URL(modJarName).openConnection()
                 .getInputStream();
         JarInputStream jin = new JarInputStream(is, true);
         int count = 0;
@@ -303,11 +319,13 @@
                 while (length >= 0) {
                     length = jin.read(buffer);
                 }
-                if (count == indexofDSA)
+                if (count == indexofDSA) {
                     fail("Should throw Security Exception");
+                }
             } catch (SecurityException e) {
-                if (count != indexofDSA)
+                if (count != indexofDSA) {
                     throw e;
+                }
             }
         }
         assertEquals(totalEntries + 1, count);
@@ -318,7 +336,7 @@
             throws IOException {
         String modJarName = Support_Resources
                 .getURL("Modified_SF_EntryAttributes.jar");
-        java.io.InputStream is = new URL(modJarName).openConnection()
+        InputStream is = new URL(modJarName).openConnection()
                 .getInputStream();
         JarInputStream jin = new JarInputStream(is, true);
         int count = 0;
@@ -332,31 +350,17 @@
                 while (length >= 0) {
                     length = jin.read(buffer);
                 }
-                if (count == indexofDSA)
+                if (count == indexofDSA) {
                     fail("Should throw Security Exception");
+                }
             } catch (SecurityException e) {
-                if (count != indexofDSA)
+                if (count != indexofDSA) {
                     throw e;
+                }
             }
         }
         assertEquals(totalEntries + 1, count);
         jin.close();
     }    
-    
-	/**
-	 * Sets up the fixture, for example, open a network connection. This method
-	 * is called before a test is executed.
-	 */
-	protected void setUp() {
-		jarName = Support_Resources.getURL("morestuff/hyts_patch.jar");
-		jarName2 = Support_Resources.getURL("morestuff/hyts_patch2.jar");
-	}
-
-	/**
-	 * Tears down the fixture, for example, close a network connection. This
-	 * method is called after a test is executed.
-	 */
-	protected void tearDown() {
-	}
 
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarOutputStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarOutputStreamTest.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarOutputStreamTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarOutputStreamTest.java Mon Sep 25 20:02:49 2006
@@ -47,13 +47,13 @@
 		final String[] manifestMain = { "foo.bar.execjartest.MainClass",
 				"foo/bar/execjartest/MainClass" };
 
-		for (int i = 0; i < manifestMain.length; i++) {
+		for (String element : manifestMain) {
 
 			// create the manifest
 			Manifest newman = new Manifest();
 			Attributes att = newman.getMainAttributes();
 			att.put(Attributes.Name.MANIFEST_VERSION, "1.0");
-			att.put(Attributes.Name.MAIN_CLASS, manifestMain[i]);
+			att.put(Attributes.Name.MAIN_CLASS, element);
 
 			File outputJar = null;
 			JarOutputStream jout = null;
@@ -77,8 +77,9 @@
 
 				byte[] bytes = new byte[1024];
 				int len;
-				while ((len = jis.read(bytes)) != -1)
-					jout.write(bytes, 0, len);
+				while ((len = jis.read(bytes)) != -1) {
+                    jout.write(bytes, 0, len);
+                }
 
 				jout.flush();
 				jout.close();
@@ -99,17 +100,19 @@
 				fail("Exception executing test JAR: " + e);
 			}
 
-			assertTrue("Error executing JAR test on: " + manifestMain[i]
+			assertTrue("Error executing JAR test on: " + element
 					+ ". Result returned was incorrect.", res
 					.startsWith("TEST"));
 			outputJar.delete();
 		}
 	}
 
-	protected void setUp() {
+	@Override
+    protected void setUp() {
 	}
 
-	protected void tearDown() {
+	@Override
+    protected void tearDown() {
 	}
 
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java Mon Sep 25 20:02:49 2006
@@ -15,8 +15,8 @@
 package org.apache.harmony.archive.tests.java.util.jar;
 
 import java.io.File;
-import java.io.InputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Map;
@@ -24,17 +24,37 @@
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 
+import junit.framework.TestCase;
 import tests.support.resource.Support_Resources;
 
-public class ManifestTest extends junit.framework.TestCase {
+public class ManifestTest extends TestCase {
 
-	final String jarName = "hyts_patch.jar";
+	private final String jarName = "hyts_patch.jar";
 
-	final String attJarName = "hyts_att.jar";
+    private final String attJarName = "hyts_att.jar";
 
-	Manifest m, m2;
+    private Manifest m;
+    
+    private Manifest m2;
 
-	File resources;
+    private File resources;
+    
+    @Override
+    protected void setUp() {
+        resources = Support_Resources.createTempFolder();
+        try {
+            Support_Resources.copyFile(resources, null, jarName);
+            JarFile jarFile = new JarFile(new File(resources, jarName));
+            m = jarFile.getManifest();
+            jarFile.close();
+            Support_Resources.copyFile(resources, null, attJarName);
+            jarFile = new JarFile(new File(resources, attJarName));
+            m2 = jarFile.getManifest();
+            jarFile.close();
+        } catch (Exception e) {
+            fail("Exception during setup: " + e.toString());
+        }
+    }
 
 	/**
 	 * @tests java.util.jar.Manifest#Manifest()
@@ -134,10 +154,10 @@
 	 */
 	public void test_getEntries() {
 		// Test for method java.util.Map java.util.jar.Manifest.getEntries()
-		Map myMap = m2.getEntries();
+		Map<String, Attributes> myMap = m2.getEntries();
 		assertNull("Shouldn't exist", myMap.get("Doesn't exist"));
 		assertEquals("Should exist",
-				"OK", ((Attributes) myMap.get("HasAttributes.txt")).get(
+				"OK", myMap.get("HasAttributes.txt").get(
 						new Attributes.Name("MyAttribute")));
 
 	}
@@ -153,33 +173,6 @@
 				Attributes.Name.MANIFEST_VERSION));
 	}
 
-	/**
-	 * Sets up the fixture, for example, open a network connection. This method
-	 * is called before a test is executed.
-	 */
-	protected void setUp() {
-		resources = Support_Resources.createTempFolder();
-		try {
-			Support_Resources.copyFile(resources, null, jarName);
-			JarFile jarFile = new JarFile(new File(resources, jarName));
-			m = jarFile.getManifest();
-			jarFile.close();
-			Support_Resources.copyFile(resources, null, attJarName);
-			jarFile = new JarFile(new File(resources, attJarName));
-			m2 = jarFile.getManifest();
-			jarFile.close();
-		} catch (Exception e) {
-			fail("Exception during setup: " + e.toString());
-		}
-	}
-
-	/**
-	 * Tears down the fixture, for example, close a network connection. This
-	 * method is called after a test is executed.
-	 */
-	protected void tearDown() {
-	}
-    
     /**
      * @tests {@link java.util.jar.Manifest#read(java.io.InputStream)
      */
@@ -200,6 +193,7 @@
             super();
         }
 
+        @Override
         public int read() {
             return 0;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/Adler32Test.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/Adler32Test.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/Adler32Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/Adler32Test.java Mon Sep 25 20:02:49 2006
@@ -156,10 +156,12 @@
 
 	}
 
-	protected void setUp() {
+	@Override
+    protected void setUp() {
 	}
 
-	protected void tearDown() {
+	@Override
+    protected void tearDown() {
 	}
 
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CRC32Test.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CRC32Test.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CRC32Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CRC32Test.java Mon Sep 25 20:02:49 2006
@@ -172,11 +172,13 @@
 				2, r);
 	}
 
-	protected void setUp() {
+	@Override
+    protected void setUp() {
 
 	}
 
-	protected void tearDown() {
+	@Override
+    protected void tearDown() {
 	}
 
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedInputStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedInputStreamTest.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedInputStreamTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedInputStreamTest.java Mon Sep 25 20:02:49 2006
@@ -122,11 +122,13 @@
 		}
 	}
 
-	protected void setUp() {
+	@Override
+    protected void setUp() {
 
 	}
 
-	protected void tearDown() {
+	@Override
+    protected void tearDown() {
 		try {
 			File deletedFile = new File("empty.txt");
 			deletedFile.delete();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedOutputStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedOutputStreamTest.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedOutputStreamTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedOutputStreamTest.java Mon Sep 25 20:02:49 2006
@@ -86,8 +86,8 @@
 			FileOutputStream outFile = new FileOutputStream("chkOut.txt");
 			CheckedOutputStream chkOut = new CheckedOutputStream(outFile,
 					new CRC32());
-			for (int i = 0; i < byteArray.length; i++) {
-				chkOut.write(byteArray[i]);
+			for (byte element : byteArray) {
+				chkOut.write(element);
 			}
 			assertTrue(
 					"the checkSum value is zero, no bytes are written to the output file",
@@ -132,10 +132,12 @@
 		}
 	}
 
-	protected void setUp() {
+	@Override
+    protected void setUp() {
 	}
 
-	protected void tearDown() {
+	@Override
+    protected void tearDown() {
 		try {
 			File deletedFile = new File("chkOut.txt");
 			deletedFile.delete();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/DeflaterOutputStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/DeflaterOutputStreamTest.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/DeflaterOutputStreamTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/DeflaterOutputStreamTest.java Mon Sep 25 20:02:49 2006
@@ -321,13 +321,15 @@
 			File f1 = new File("writeI1.tst");
 			FileOutputStream fos = new FileOutputStream(f1);
 			DeflaterOutputStream dos = new DeflaterOutputStream(fos);
-			for (int i = 0; i < 3; i++)
-				dos.write(i);
+			for (int i = 0; i < 3; i++) {
+                dos.write(i);
+            }
 			dos.close();
 			FileInputStream fis = new FileInputStream(f1);
 			InflaterInputStream iis = new InflaterInputStream(fis);
-			for (int i = 0; i < 3; i++)
-				assertTrue("Incorrect Byte Returned.", iis.read() == i);
+			for (int i = 0; i < 3; i++) {
+                assertTrue("Incorrect Byte Returned.", iis.read() == i);
+            }
 			assertEquals("Incorrect Byte Returned (EOF).", -1, iis.read());
 			assertEquals("Incorrect Byte Returned (EOF).", -1, iis.read());
 			iis.close();
@@ -432,7 +434,8 @@
 		}
 	}
 
-	protected void setUp() {
+	@Override
+    protected void setUp() {
 		// setting up a deflater to be used
 		byte byteArray[] = { 1, 3, 4, 7, 8 };
 		int x = 0;
@@ -448,7 +451,8 @@
 		deflate.end();
 	}
 
-	protected void tearDown() {
+	@Override
+    protected void tearDown() {
 
 	}
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/DeflaterTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/DeflaterTest.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/DeflaterTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/DeflaterTest.java Mon Sep 25 20:02:49 2006
@@ -74,8 +74,9 @@
 		Deflater defl = new Deflater();
 		defl.setInput(byteArray);
 		defl.finish();
-		while (!defl.finished())
-			x += defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            x += defl.deflate(outPutBuf);
+        }
 		assertEquals("Deflater at end of stream, should return 0", 0, defl
 				.deflate(outPutBuf));
 		int totalOut = defl.getTotalOut();
@@ -92,8 +93,9 @@
 		Inflater infl = new Inflater();
 		try {
 			infl.setInput(outPutBuf);
-			while (!infl.finished())
-				infl.inflate(outPutInf);
+			while (!infl.finished()) {
+                infl.inflate(outPutInf);
+            }
 		} catch (DataFormatException e) {
 			fail("Invalid input to be decompressed");
 		}
@@ -103,10 +105,11 @@
 		assertTrue(
 				"Inflates getTotalIn() did not correspond with deflates getTotalOut()",
 				infl.getTotalIn() == totalOut);
-		for (int i = 0; i < byteArray.length; i++)
-			assertTrue(
+		for (int i = 0; i < byteArray.length; i++) {
+            assertTrue(
 					"Final decompressed data does not equal the original data",
 					byteArray[i] == outPutInf[i]);
+        }
 		assertEquals("Final decompressed data contained more bytes than original",
 				0, outPutInf[byteArray.length]);
 		infl.end();
@@ -127,8 +130,9 @@
 		Deflater defl = new Deflater();
 		defl.setInput(byteArray);
 		defl.finish();
-		while (!defl.finished())
-			x += defl.deflate(outPutBuf, offSet, length);
+		while (!defl.finished()) {
+            x += defl.deflate(outPutBuf, offSet, length);
+        }
 		assertEquals("Deflater at end of stream, should return 0", 0, defl.deflate(
 				outPutBuf, offSet, length));
 		int totalOut = defl.getTotalOut();
@@ -144,8 +148,9 @@
 		Inflater infl = new Inflater();
 		try {
 			infl.setInput(outPutBuf, offSet, length);
-			while (!infl.finished())
-				infl.inflate(outPutInf);
+			while (!infl.finished()) {
+                infl.inflate(outPutInf);
+            }
 		} catch (DataFormatException e) {
 			fail("Invalid input to be decompressed");
 		}
@@ -155,10 +160,11 @@
 		assertTrue(
 				"inflates getTotalIn() did not correspond with deflates getTotalOut()",
 				infl.getTotalIn() == totalOut);
-		for (int i = 0; i < byteArray.length; i++)
-			assertTrue(
+		for (int i = 0; i < byteArray.length; i++) {
+            assertTrue(
 					"Final decompressed data does not equal the original data",
 					byteArray[i] == outPutInf[i]);
+        }
 		assertEquals("Final decompressed data contained more bytes than original",
 				0, outPutInf[byteArray.length]);
 		infl.end();
@@ -197,8 +203,9 @@
 		Deflater defl = new Deflater();
 		defl.setInput(byteArray);
 		defl.finish();
-		while (!defl.finished())
-			defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            defl.deflate(outPutBuf);
+        }
 		defl.end();
 		helper_end_test(defl, "end");
 	}
@@ -229,13 +236,15 @@
 		defl.finish();
 
 		// needsInput should never return true after finish() is called
-		if (System.getProperty("java.vendor").startsWith("IBM"))
-			assertTrue(
+		if (System.getProperty("java.vendor").startsWith("IBM")) {
+            assertTrue(
 					"needsInput() should return false after finish() is called",
 					!defl.needsInput());
+        }
 
-		while (!defl.finished())
-			x += defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            x += defl.deflate(outPutBuf);
+        }
 		int totalOut = defl.getTotalOut();
 		int totalIn = defl.getTotalIn();
 		assertTrue(
@@ -249,8 +258,9 @@
 		Inflater infl = new Inflater();
 		try {
 			infl.setInput(outPutBuf);
-			while (!infl.finished())
-				infl.inflate(outPutInf);
+			while (!infl.finished()) {
+                infl.inflate(outPutInf);
+            }
 		} catch (DataFormatException e) {
 			fail("Invalid input to be decompressed");
 		}
@@ -260,10 +270,11 @@
 		assertTrue(
 				"Inflates getTotalIn() did not correspond with deflates getTotalOut()",
 				infl.getTotalIn() == totalOut);
-		for (int i = 0; i < byteArray.length; i++)
-			assertTrue(
+		for (int i = 0; i < byteArray.length; i++) {
+            assertTrue(
 					"Final decompressed data does not equal the original data",
 					byteArray[i] == outPutInf[i]);
+        }
 		assertEquals("Final decompressed data contained more bytes than original",
 				0, outPutInf[byteArray.length]);
 		infl.end();
@@ -282,8 +293,9 @@
 		assertTrue("Test 2: Deflater should not be finished.", !defl.finished());
 		defl.finish();
 		assertTrue("Test 3: Deflater should not be finished.", !defl.finished());
-		while (!defl.finished())
-			defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            defl.deflate(outPutBuf);
+        }
 		assertTrue("Test 4: Deflater should be finished.", defl.finished());
 		defl.end();
 		assertTrue("Test 5: Deflater should be finished.", defl.finished());
@@ -301,8 +313,9 @@
 		// getting the checkSum value using the Adler
 		defl.setInput(byteArray);
 		defl.finish();
-		while (!defl.finished())
-			defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            defl.deflate(outPutBuf);
+        }
 		long checkSumD = defl.getAdler();
 		defl.end();
 
@@ -326,8 +339,9 @@
 		Deflater defl = new Deflater();
 		defl.setInput(byteArray);
 		defl.finish();
-		while (!defl.finished())
-			defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            defl.deflate(outPutBuf);
+        }
 		assertTrue(
 				"The number of input byte from the array did not correspond with getTotalIn",
 				defl.getTotalIn() == byteArray.length);
@@ -339,8 +353,9 @@
 		outPutBuf = new byte[5];
 		defl.setInput(byteArray, offSet, length);
 		defl.finish();
-		while (!defl.finished())
-			defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            defl.deflate(outPutBuf);
+        }
 		assertTrue(
 				"The number of input byte sent to setInputBII() did not corrsepond with getTotalIn",
 				defl.getTotalIn() == length);
@@ -359,8 +374,9 @@
 		Deflater defl = new Deflater();
 		defl.setInput(byteArray);
 		defl.finish();
-		while (!defl.finished())
-			x += defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            x += defl.deflate(outPutBuf);
+        }
 		assertTrue(
 				"The total number of bytes from deflate() did not equal getTotalOut",
 				x == defl.getTotalOut());
@@ -373,8 +389,9 @@
 		outPutBuf = new byte[5];
 		defl.setInput(byteArray, offSet, length);
 		defl.finish();
-		while (!defl.finished())
-			x += defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            x += defl.deflate(outPutBuf);
+        }
 		assertTrue(
 				"The total number of bytes from deflateBII() did not equal getTotalOut",
 				x == defl.getTotalOut());
@@ -395,8 +412,9 @@
 				"needsInput give wrong boolean value as a result of a full input buffer",
 				!defl.needsInput());
 		byte[] outPutBuf = new byte[50];
-		while (!defl.needsInput())
-			defl.deflate(outPutBuf);
+		while (!defl.needsInput()) {
+            defl.deflate(outPutBuf);
+        }
 		byte emptyByteArray[] = new byte[0];
 		defl.setInput(emptyByteArray);
 		assertTrue(
@@ -404,14 +422,16 @@
 				defl.needsInput());
 		defl.setInput(byteArray);
 		defl.finish();
-		while (!defl.finished())
-			defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            defl.deflate(outPutBuf);
+        }
 		// needsInput should NOT return true after finish() has been
 		// called.
-		if (System.getProperty("java.vendor").startsWith("IBM"))
-			assertTrue(
+		if (System.getProperty("java.vendor").startsWith("IBM")) {
+            assertTrue(
 					"needsInput gave wrong boolean value as a result of finish() being called",
 					!defl.needsInput());
+        }
 		defl.end();
 	}
 
@@ -430,53 +450,60 @@
 		Deflater defl = new Deflater();
 
 		for (int i = 0; i < 3; i++) {
-			if (i == 0)
-				curArray = byteArray;
-			else if (i == 1)
-				curArray = byteArray2;
-			else
-				defl.reset();
+			if (i == 0) {
+                curArray = byteArray;
+            } else if (i == 1) {
+                curArray = byteArray2;
+            } else {
+                defl.reset();
+            }
 
 			defl.setInput(curArray);
 			defl.finish();
-			while (!defl.finished())
-				x += defl.deflate(outPutBuf);
+			while (!defl.finished()) {
+                x += defl.deflate(outPutBuf);
+            }
 
-			if (i == 0)
-				assertTrue(
+			if (i == 0) {
+                assertTrue(
 						"The total number of bytes from deflate did not equal getTotalOut",
 						x == defl.getTotalOut());
-			else if (i == 1)
-				assertTrue(
+            } else if (i == 1) {
+                assertTrue(
 						"The total number of bytes from deflate should still be the same ("
 								+ x + ")", x == orgValue);
-			else
-				assertTrue(
+            } else {
+                assertTrue(
 						"The total number of bytes from deflate should be doubled ("
 								+ orgValue * 2 + ")", x == orgValue * 2);
+            }
 
-			if (i == 0)
-				orgValue = x;
+			if (i == 0) {
+                orgValue = x;
+            }
 
 			try {
 				Inflater infl = new Inflater();
 				infl.setInput(outPutBuf);
-				while (!infl.finished())
-					infl.inflate(outPutInf);
+				while (!infl.finished()) {
+                    infl.inflate(outPutInf);
+                }
 				infl.end();
 			} catch (DataFormatException e) {
 				fail("Test " + i + ": Invalid input to be decompressed");
 			}
 
-			if (i == 1)
-				curArray = byteArray;
+			if (i == 1) {
+                curArray = byteArray;
+            }
 
-			for (int j = 0; j < curArray.length; j++)
-				assertTrue(
+			for (int j = 0; j < curArray.length; j++) {
+                assertTrue(
 						"Test "
 								+ i
 								+ ": Final decompressed data does not equal the original data",
 						curArray[j] == outPutInf[j]);
+            }
 			assertTrue(
 					"Test "
 							+ i
@@ -513,8 +540,9 @@
 
 		defl.setInput(byteArray);
 		defl.finish();
-		while (!defl.finished())
-			defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            defl.deflate(outPutBuf);
+        }
 		deflAdler = defl.getAdler();
 		adl = new Adler32();
 		adl.update(byteArray);
@@ -557,8 +585,9 @@
 				deflAdler == realAdler);
 
 		defl.setInput(byteArray);
-		while (!defl.needsInput())
-			defl.deflate(outPutBuf);
+		while (!defl.needsInput()) {
+            defl.deflate(outPutBuf);
+        }
 		deflAdler = defl.getAdler();
 		adl = new Adler32();
 		adl.update(byteArray);
@@ -609,22 +638,25 @@
 		// false
 		defl.setInput(byteArray);
 		defl.finish();
-		while (!defl.finished())
-			defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            defl.deflate(outPutBuf);
+        }
 		defl.end();
 
 		Inflater infl = new Inflater();
 		try {
 			infl.setInput(outPutBuf);
-			while (!infl.finished())
-				infl.inflate(outPutInf);
+			while (!infl.finished()) {
+                infl.inflate(outPutInf);
+            }
 		} catch (DataFormatException e) {
 			fail("Invalid input to be decompressed");
 		}
-		for (int i = 0; i < byteArray.length; i++)
-			assertTrue(
+		for (int i = 0; i < byteArray.length; i++) {
+            assertTrue(
 					"Final decompressed data does not equal the original data",
 					byteArray[i] == outPutInf[i]);
+        }
 		assertTrue(
 				"Inflater.getTotalOut should have been equal to the length of the input",
 				infl.getTotalOut() == byteArray.length);
@@ -650,22 +682,25 @@
 		// false
 		defl.setInput(byteArray, offSet, length);
 		defl.finish();
-		while (!defl.finished())
-			defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            defl.deflate(outPutBuf);
+        }
 		defl.end();
 
 		Inflater infl = new Inflater();
 		try {
 			infl.setInput(outPutBuf);
-			while (!infl.finished())
-				infl.inflate(outPutInf);
+			while (!infl.finished()) {
+                infl.inflate(outPutInf);
+            }
 		} catch (DataFormatException e) {
 			fail("Invalid input to be decompressed");
 		}
-		for (int i = 0; i < length; i++)
-			assertTrue(
+		for (int i = 0; i < length; i++) {
+            assertTrue(
 					"Final decompressed data does not equal the original data",
 					byteArray[i + offSet] == outPutInf[i]);
+        }
 		assertTrue(
 				"Inflater.getTotalOut should have been equal to the length of the input",
 				infl.getTotalOut() == length);
@@ -714,22 +749,26 @@
 			defl.setLevel(i);
 			outPutBuf = new byte[500];
 			defl.setInput(byteArray);
-			while (!defl.needsInput())
-				defl.deflate(outPutBuf);
+			while (!defl.needsInput()) {
+                defl.deflate(outPutBuf);
+            }
 			defl.finish();
-			while (!defl.finished())
-				defl.deflate(outPutBuf);
+			while (!defl.finished()) {
+                defl.deflate(outPutBuf);
+            }
 			totalOut = defl.getTotalOut();
 			defl.end();
 
 			outPutBuf = new byte[500];
 			defl = new Deflater(i);
 			defl.setInput(byteArray);
-			while (!defl.needsInput())
-				defl.deflate(outPutBuf);
+			while (!defl.needsInput()) {
+                defl.deflate(outPutBuf);
+            }
 			defl.finish();
-			while (!defl.finished())
-				defl.deflate(outPutBuf);
+			while (!defl.finished()) {
+                defl.deflate(outPutBuf);
+            }
 			assertTrue(
 					"getTotalOut() not equal comparing two Deflaters with same compression level.",
 					defl.getTotalOut() == totalOut);
@@ -773,19 +812,22 @@
 			byte outPutBuf[] = new byte[500];
 			MyDeflater mdefl = new MyDeflater();
 
-			if (i == 0)
-				mdefl.setStrategy(mdefl.getDefStrategy());
-			else if (i == 1)
-				mdefl.setStrategy(mdefl.getHuffman());
-			else
-				mdefl.setStrategy(mdefl.getFiltered());
+			if (i == 0) {
+                mdefl.setStrategy(mdefl.getDefStrategy());
+            } else if (i == 1) {
+                mdefl.setStrategy(mdefl.getHuffman());
+            } else {
+                mdefl.setStrategy(mdefl.getFiltered());
+            }
 
 			mdefl.setInput(byteArray);
-			while (!mdefl.needsInput())
-				mdefl.deflate(outPutBuf);
+			while (!mdefl.needsInput()) {
+                mdefl.deflate(outPutBuf);
+            }
 			mdefl.finish();
-			while (!mdefl.finished())
-				mdefl.deflate(outPutBuf);
+			while (!mdefl.finished()) {
+                mdefl.deflate(outPutBuf);
+            }
 
 			if (i == 0) {
 				// System.out.println(mdefl.getTotalOut());
@@ -837,11 +879,13 @@
 		Deflater defl = new Deflater();
 		byte[] outPutBuf = new byte[500];
 		defl.setInput(byteArray);
-		while (!defl.needsInput())
-			defl.deflate(outPutBuf);
+		while (!defl.needsInput()) {
+            defl.deflate(outPutBuf);
+        }
 		defl.finish();
-		while (!defl.finished())
-			defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            defl.deflate(outPutBuf);
+        }
 		int totalOut = defl.getTotalOut();
 		defl.end();
 
@@ -850,11 +894,13 @@
 		mdefl = new MyDeflater(mdefl.getDefCompression());
 		outPutBuf = new byte[500];
 		mdefl.setInput(byteArray);
-		while (!mdefl.needsInput())
-			mdefl.deflate(outPutBuf);
+		while (!mdefl.needsInput()) {
+            mdefl.deflate(outPutBuf);
+        }
 		mdefl.finish();
-		while (!mdefl.finished())
-			mdefl.deflate(outPutBuf);
+		while (!mdefl.finished()) {
+            mdefl.deflate(outPutBuf);
+        }
 		assertTrue(
 				"getTotalOut() not equal comparing two Deflaters with same compression level.",
 				mdefl.getTotalOut() == totalOut);
@@ -873,22 +919,26 @@
 		byte outPutBuf[] = new byte[500];
 		defl.setLevel(2);
 		defl.setInput(byteArray);
-		while (!defl.needsInput())
-			defl.deflate(outPutBuf);
+		while (!defl.needsInput()) {
+            defl.deflate(outPutBuf);
+        }
 		defl.finish();
-		while (!defl.finished())
-			defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            defl.deflate(outPutBuf);
+        }
 		int totalOut = defl.getTotalOut();
 		defl.end();
 
 		outPutBuf = new byte[500];
 		defl = new Deflater(2, false);
 		defl.setInput(byteArray);
-		while (!defl.needsInput())
-			defl.deflate(outPutBuf);
+		while (!defl.needsInput()) {
+            defl.deflate(outPutBuf);
+        }
 		defl.finish();
-		while (!defl.finished())
-			defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            defl.deflate(outPutBuf);
+        }
 		assertTrue(
 				"getTotalOut() not equal comparing two Deflaters with same compression level.",
 				defl.getTotalOut() == totalOut);
@@ -897,11 +947,13 @@
 		outPutBuf = new byte[500];
 		defl = new Deflater(2, true);
 		defl.setInput(byteArray);
-		while (!defl.needsInput())
-			defl.deflate(outPutBuf);
+		while (!defl.needsInput()) {
+            defl.deflate(outPutBuf);
+        }
 		defl.finish();
-		while (!defl.finished())
-			defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            defl.deflate(outPutBuf);
+        }
 		assertTrue(
 				"getTotalOut() should not be equal comparing two Deflaters with different header options.",
 				defl.getTotalOut() != totalOut);
@@ -911,18 +963,20 @@
 		Inflater infl = new Inflater(true);
 		try {
 			while (!infl.finished()) {
-				if (infl.needsInput())
-					infl.setInput(outPutBuf);
+				if (infl.needsInput()) {
+                    infl.setInput(outPutBuf);
+                }
 				infl.inflate(outPutInf);
 			}
 		} catch (DataFormatException e) {
 			fail(
 					"invalid input to inflate - called in test constructorIZ");
 		}
-		for (int i = 0; i < byteArray.length; i++)
-			assertTrue(
+		for (int i = 0; i < byteArray.length; i++) {
+            assertTrue(
 					"Final decompressed data does not equal the original data",
 					byteArray[i] == outPutInf[i]);
+        }
 		assertEquals("final decompressed data contained more bytes than original - construcotrIZ",
 				0, outPutInf[byteArray.length]);
 		infl.end();
@@ -932,8 +986,9 @@
 		int r = 0;
 		try {
 			while (!infl.finished()) {
-				if (infl.needsInput())
-					infl.setInput(outPutBuf);
+				if (infl.needsInput()) {
+                    infl.setInput(outPutBuf);
+                }
 				infl.inflate(outPutInf);
 			}
 		} catch (DataFormatException e) {
@@ -977,11 +1032,13 @@
 		byte outPutBuf[] = new byte[500];
 		Deflater defl = new Deflater(3);
 		defl.setInput(byteArray);
-		while (!defl.needsInput())
-			defl.deflate(outPutBuf);
+		while (!defl.needsInput()) {
+            defl.deflate(outPutBuf);
+        }
 		defl.finish();
-		while (!defl.finished())
-			defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            defl.deflate(outPutBuf);
+        }
 		int totalOut = defl.getTotalOut();
 		defl.end();
 
@@ -991,11 +1048,13 @@
 		defl = new Deflater();
 		defl.setLevel(3);
 		defl.setInput(byteArray);
-		while (!defl.needsInput())
-			defl.deflate(outPutBuf);
+		while (!defl.needsInput()) {
+            defl.deflate(outPutBuf);
+        }
 		defl.finish();
-		while (!defl.finished())
-			defl.deflate(outPutBuf);
+		while (!defl.finished()) {
+            defl.deflate(outPutBuf);
+        }
 		assertTrue(
 				"getTotalOut() not equal comparing two Deflaters with same compression level.",
 				defl.getTotalOut() == totalOut);
@@ -1132,12 +1191,6 @@
         assertEquals(0, inf.getBytesRead());
         assertEquals(0, inf.getBytesWritten());
     }
-    
-	protected void setUp() {
-	}
-
-	protected void tearDown() {
-	}
 
     /**
      * @throws DataFormatException

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/GZIPInputStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/GZIPInputStreamTest.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/GZIPInputStreamTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/GZIPInputStreamTest.java Mon Sep 25 20:02:49 2006
@@ -106,8 +106,9 @@
 			Support_Resources.copyFile(resources, "GZIPInputStream",
 					"hyts_gInput.txt.gz");
 			String resPath = resources.toString();
-			if (resPath.charAt(0) == '/' || resPath.charAt(0) == '\\')
-				resPath = resPath.substring(1);
+			if (resPath.charAt(0) == '/' || resPath.charAt(0) == '\\') {
+                resPath = resPath.substring(1);
+            }
 			final URL gInput = new URL("file:/" + resPath
 					+ "/GZIPInputStream/hyts_gInput.txt.gz");
 			TestGZIPInputStream inGZIP = new TestGZIPInputStream(gInput
@@ -141,10 +142,12 @@
 			// header),
 			// the size of the InflaterStream internal buffer
 			byte[] test = new byte[507];
-			for (int i = 0; i < 256; i++)
-				test[i] = (byte) i;
-			for (int i = 256; i < test.length; i++)
-				test[i] = (byte) (256 - i);
+			for (int i = 0; i < 256; i++) {
+                test[i] = (byte) i;
+            }
+			for (int i = 256; i < test.length; i++) {
+                test[i] = (byte) (256 - i);
+            }
 			ByteArrayOutputStream bout = new ByteArrayOutputStream();
 			GZIPOutputStream out = new GZIPOutputStream(bout);
 			out.write(test);
@@ -153,8 +156,9 @@
 			GZIPInputStream gin2 = new GZIPInputStream(
 					new ByteArrayInputStream(comp), 512);
 			int result, total = 0;
-			while ((result = gin2.read(test)) != -1)
-				total += result;
+			while ((result = gin2.read(test)) != -1) {
+                total += result;
+            }
 			assertEquals("Should return -1", -1, gin2.read());
 			gin2.close();
 			assertTrue("Incorrectly decompressed", total == test.length);
@@ -181,8 +185,9 @@
 			gin2 = new GZIPInputStream(new ByteArrayInputStream(comp), 512);
 			boolean exception = false;
 			try {
-				while (gin2.read(test) != -1)
-					;
+				while (gin2.read(test) != -1) {
+                    ;
+                }
 			} catch (IOException e) {
 				exception = true;
 			}
@@ -203,8 +208,9 @@
 			Support_Resources.copyFile(resources, "GZIPInputStream",
 					"hyts_gInput.txt.gz");
 			String resPath = resources.toString();
-			if (resPath.charAt(0) == '/' || resPath.charAt(0) == '\\')
-				resPath = resPath.substring(1);
+			if (resPath.charAt(0) == '/' || resPath.charAt(0) == '\\') {
+                resPath = resPath.substring(1);
+            }
 			final URL gInput = new URL("file:/" + resPath
 					+ "/GZIPInputStream/hyts_gInput.txt.gz");
 			TestGZIPInputStream inGZIP = new TestGZIPInputStream(gInput
@@ -229,11 +235,13 @@
 		}
 	}
 
-	protected void setUp() {
+	@Override
+    protected void setUp() {
 		resources = Support_Resources.createTempFolder();
 	}
 
-	protected void tearDown() {
+	@Override
+    protected void tearDown() {
 	}
 
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/GZIPOutputStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/GZIPOutputStreamTest.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/GZIPOutputStreamTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/GZIPOutputStreamTest.java Mon Sep 25 20:02:49 2006
@@ -156,10 +156,12 @@
 		}
 	}
 
-	protected void setUp() {
+	@Override
+    protected void setUp() {
 	}
 
-	protected void tearDown() {
+	@Override
+    protected void tearDown() {
 
 		try {
 			File dFile = new File("GZIPOutCon.txt");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/InflaterInputStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/InflaterInputStreamTest.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/InflaterInputStreamTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/InflaterInputStreamTest.java Mon Sep 25 20:02:49 2006
@@ -283,12 +283,13 @@
 		for (int i = 0; i < 11; i++) {
 			read = iis.read();
 			available = iis.available();
-			if (read == -1)
-				assertEquals("Bytes Available Should Return 0 ",
+			if (read == -1) {
+                assertEquals("Bytes Available Should Return 0 ",
 						0, available);
-			else
-				assertEquals("Bytes Available Should Return 1.",
+            } else {
+                assertEquals("Bytes Available Should Return 1.",
 						1, available);
+            }
 		}
 
 		iis.close();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/InflaterTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/InflaterTest.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/InflaterTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/InflaterTest.java Mon Sep 25 20:02:49 2006
@@ -618,7 +618,8 @@
 		assertEquals("boundary check is not present for setInput", 1, r);
 	}
 
-	protected void setUp() {
+	@Override
+    protected void setUp() {
 		try {
 			java.io.InputStream infile = Support_Resources
 					.getStream("hyts_compressD.txt");
@@ -643,7 +644,8 @@
 		}
 	}
 
-	protected void tearDown() {
+	@Override
+    protected void tearDown() {
 	}
     
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipEntryTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipEntryTest.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipEntryTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipEntryTest.java Mon Sep 25 20:02:49 2006
@@ -25,7 +25,7 @@
 
 	java.util.zip.ZipFile zfile;
 
-	private static String platformId = System.getProperty(
+	private static final String platformId = System.getProperty(
 			"com.ibm.oti.configuration", "JDK")
 			+ System.getProperty("java.vm.version");
 
@@ -54,8 +54,9 @@
 		} catch (NullPointerException e) {
 		}
 		StringBuffer s = new StringBuffer();
-		for (int i = 0; i < 65535; i++)
-			s.append('a');
+		for (int i = 0; i < 65535; i++) {
+            s.append('a');
+        }
 		try {
 			zentry = new ZipEntry(s.toString());
 		} catch (IllegalArgumentException e) {
@@ -184,8 +185,9 @@
 		zentry.setComment(n);
 		assertNull("Comment not correctly set", zentry.getComment());
 		StringBuffer s = new StringBuffer();
-		for (int i = 0; i < 0xFFFF; i++)
-			s.append('a');
+		for (int i = 0; i < 0xFFFF; i++) {
+            s.append('a');
+        }
 		try {
 			zentry.setComment(s.toString());
 		} catch (IllegalArgumentException e) {
@@ -427,7 +429,8 @@
 	 * is called before a test is executed.
 	 */
 
-	protected void setUp() {
+	@Override
+    protected void setUp() {
 		java.io.File f = null;
 		try {
 			byte[] rbuf = new byte[2000];
@@ -441,7 +444,7 @@
 			java.io.InputStream is = Support_Resources
 					.getStream("hyts_ZipFile.zip");
 			java.io.FileOutputStream fos = new java.io.FileOutputStream(f);
-			rbuf = new byte[(int) is.available()];
+			rbuf = new byte[is.available()];
 			is.read(rbuf, 0, rbuf.length);
 			fos.write(rbuf, 0, rbuf.length);
 			is.close();
@@ -465,10 +468,12 @@
 	 * method is called after a test is executed.
 	 */
 
-	protected void tearDown() {
+	@Override
+    protected void tearDown() {
 		try {
-			if (zfile != null)
-				zfile.close();
+			if (zfile != null) {
+                zfile.close();
+            }
 			java.io.File f = new java.io.File(tempFileName);
 			f.delete();
 		} catch (java.io.IOException e) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipFileTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipFileTest.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipFileTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipFileTest.java Mon Sep 25 20:02:49 2006
@@ -29,9 +29,9 @@
 public class ZipFileTest extends junit.framework.TestCase {
 
 	// the file hyts_zipFile.zip in setup must be included as a resource
-	String tempFileName;
+	private String tempFileName;
 
-	private java.util.zip.ZipFile zfile;
+	private ZipFile zfile;
 
 	/**
 	 * @tests java.util.zip.ZipFile#ZipFile(java.io.File)
@@ -92,8 +92,9 @@
 			OutputStream out = new FileOutputStream(file);
 			int result;
 			byte[] buf = new byte[4096];
-			while ((result = in.read(buf)) != -1)
-				out.write(buf, 0, result);
+			while ((result = in.read(buf)) != -1) {
+                out.write(buf, 0, result);
+            }
 			in.close();
 			out.close();
 			/*
@@ -133,7 +134,7 @@
 	 */
 	public void test_entries() {
 		// Test for method java.util.Enumeration java.util.zip.ZipFile.entries()
-		java.util.Enumeration enumer = zfile.entries();
+		Enumeration<? extends ZipEntry> enumer = zfile.entries();
 		int c = 0;
 		while (enumer.hasMoreElements()) {
 			++c;
@@ -142,7 +143,7 @@
 		assertTrue("Incorrect number of entries returned: " + c, c == 6);
 
 		try {
-			Enumeration enumeration = zfile.entries();
+			Enumeration<? extends ZipEntry> enumeration = zfile.entries();
 			zfile.close();
 			zfile = null;
 			boolean pass = false;
@@ -242,7 +243,8 @@
 	 * Sets up the fixture, for example, open a network connection. This method
 	 * is called before a test is executed.
 	 */
-	protected void setUp() {
+	@Override
+    protected void setUp() {
 		try {
 			byte[] rbuf = new byte[2000];
 			// Create a local copy of the file since some tests want to alter
@@ -250,18 +252,19 @@
 			tempFileName = System.getProperty("user.dir");
 			String separator = System.getProperty("file.separator");
 			if (tempFileName.charAt(tempFileName.length() - 1) == separator
-					.charAt(0))
-				tempFileName = Support_PlatformFile.getNewPlatformFile(
+					.charAt(0)) {
+                tempFileName = Support_PlatformFile.getNewPlatformFile(
 						tempFileName, "gabba.zip");
-			else
-				tempFileName = Support_PlatformFile.getNewPlatformFile(
+            } else {
+                tempFileName = Support_PlatformFile.getNewPlatformFile(
 						tempFileName + separator, "gabba.zip");
+            }
 
 			File f = new File(tempFileName);
 			f.delete();
 			InputStream is = Support_Resources.getStream("hyts_ZipFile.zip");
 			FileOutputStream fos = new FileOutputStream(f);
-			rbuf = new byte[(int) is.available()];
+			rbuf = new byte[is.available()];
 			is.read(rbuf, 0, rbuf.length);
 			fos.write(rbuf, 0, rbuf.length);
 			is.close();
@@ -277,12 +280,14 @@
 	 * Tears down the fixture, for example, close a network connection. This
 	 * method is called after a test is executed.
 	 */
-	protected void tearDown() {
+	@Override
+    protected void tearDown() {
 		try {
-			if (zfile != null)
-				// Note zfile is a user-defined zip file used by other tests and
+			if (zfile != null) {
+                // Note zfile is a user-defined zip file used by other tests and
 				// should not be deleted
 				zfile.close();
+            }
 		} catch (Exception e) {
 		}
 	}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipInputStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipInputStreamTest.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipInputStreamTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipInputStreamTest.java Mon Sep 25 20:02:49 2006
@@ -16,7 +16,6 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
-import java.io.IOException;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 import java.util.zip.ZipOutputStream;
@@ -164,12 +163,14 @@
 	 * Sets up the fixture, for example, open a network connection. This method
 	 * is called before a test is executed.
 	 */
-	protected void setUp() {
+	@Override
+    protected void setUp() {
 		try {
 			java.io.InputStream is = Support_Resources
 					.getStream("hyts_ZipFile.zip");
-			if (is == null)
-				System.out.println("file hyts_ZipFile.zip can not be found");
+			if (is == null) {
+                System.out.println("file hyts_ZipFile.zip can not be found");
+            }
 			zis = new ZipInputStream(is);
             
             ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -190,12 +191,14 @@
 	 * Tears down the fixture, for example, close a network connection. This
 	 * method is called after a test is executed.
 	 */
-	protected void tearDown() {
+	@Override
+    protected void tearDown() {
 
-		if (zis != null)
-			try {
+		if (zis != null) {
+            try {
 				zis.close();
 			} catch (Exception e) {
 			}
+        }
 	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipOutputStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipOutputStreamTest.java?view=diff&rev=449886&r1=449885&r2=449886
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipOutputStreamTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipOutputStreamTest.java Mon Sep 25 20:02:49 2006
@@ -189,8 +189,9 @@
         byte[] b = new byte[data.length()];
         int r = 0;
         int count = 0;
-        while (count != b.length && (r = zis.read(b, count, b.length)) != -1)
+        while (count != b.length && (r = zis.read(b, count, b.length)) != -1) {
             count += r;
+        }
         zis.closeEntry();
         assertTrue("Write failed to write correct bytes", new String(b)
                 .equals(data));
@@ -256,17 +257,21 @@
         }
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         zos = new ZipOutputStream(bos = new ByteArrayOutputStream());
     }
 
+    @Override
     protected void tearDown() throws Exception {
         try {
-            if (zos != null)
+            if (zos != null) {
                 zos.close();
-            if (zis != null)
+            }
+            if (zis != null) {
                 zis.close();
+            }
         } catch (Exception e) {}
         super.tearDown();
     }



Mime
View raw message