harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r415892 - /incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/Manifest.java
Date Wed, 21 Jun 2006 03:51:41 GMT
Author: ndbeyer
Date: Tue Jun 20 20:51:41 2006
New Revision: 415892

URL: http://svn.apache.org/viewvc?rev=415892&view=rev
Log:
Minor cleanup and spelling correction.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/Manifest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/Manifest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/Manifest.java?rev=415892&r1=415891&r2=415892&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/Manifest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/Manifest.java
Tue Jun 20 20:51:41 2006
@@ -88,7 +88,7 @@
 	 * @return The Attributes for the entry or null if the entry does not exist.
 	 */
 	public Attributes getAttributes(String name) {
-		return (Attributes) getEntries().get(name);
+		return getEntries().get(name);
 	}
 
 	/**
@@ -159,10 +159,12 @@
 			if (out.length > limit) {
 				while (out.length - offset >= limit) {
 					int len = out.length - offset;
-					if (len > limit)
-						len = limit;
-					if (offset > 0)
-						os.write(' ');
+					if (len > limit) {
+                        len = limit;
+                    }
+					if (offset > 0) {
+                        os.write(' ');
+                    }
 					os.write(out, offset, len);
 					os.write(sepBuf);
 					offset += len;
@@ -177,25 +179,29 @@
 				if (oneChar[0] < 128 || charset == null) {
 					oneByte[0] = (byte) oneChar[0];
 					buf = oneByte;
-				} else
-					buf = charset.encode(CharBuffer.wrap(oneChar, 0, 1)).array();
+				} else {
+                    buf = charset.encode(CharBuffer.wrap(oneChar, 0, 1)).array();
+                }
 				if (size + buf.length > limit) {
-					if (limit != LIMIT)
-						os.write(' ');
+					if (limit != LIMIT) {
+                        os.write(' ');
+                    }
 					os.write(outBuf, 0, size);
 					os.write(sepBuf);
 					limit = LIMIT - 1;
 					size = 0;
 				}
-				if (buf.length == 1)
-					outBuf[size] = buf[0];
-				else
-					System.arraycopy(buf, 0, outBuf, size, buf.length);
+				if (buf.length == 1) {
+                    outBuf[size] = buf[0];
+                } else {
+                    System.arraycopy(buf, 0, outBuf, size, buf.length);
+                }
 				size += buf.length;
 			}
 			if (size > 0) {
-				if (limit != LIMIT)
-					os.write(' ');
+				if (limit != LIMIT) {
+                    os.write(' ');
+                }
 				os.write(outBuf, 0, size);
 				os.write(sepBuf);
 			}
@@ -219,8 +225,9 @@
 			String encoding = AccessController
 					.doPrivileged(new PriviAction<String>("manifest.write.encoding"));
 			if (encoding != null) {
-				if ("".equals(encoding))
-					encoding = "UTF8";
+				if ("".equals(encoding)) {
+                    encoding = "UTF8";
+                }
 				charset = Charset.forName(encoding);				
 			}
 			String version = manifest.mainAttributes
@@ -230,8 +237,9 @@
 				Iterator<?> entries = manifest.mainAttributes.keySet().iterator();
 				while (entries.hasNext()) {
 					Attributes.Name name = (Attributes.Name) entries.next();
-					if (!name.equals(Attributes.Name.MANIFEST_VERSION))
-						writeEntry(name, manifest.mainAttributes.getValue(name));
+					if (!name.equals(Attributes.Name.MANIFEST_VERSION)) {
+                        writeEntry(name, manifest.mainAttributes.getValue(name));
+                    }
 				}
 			}
 			os.write(sepBuf);
@@ -239,8 +247,7 @@
 			while (i.hasNext()) {
 				String key = i.next();
 				writeEntry(nameAttribute, key);
-				Attributes attrib = (Attributes) manifest.entryAttributes
-						.get(key);
+				Attributes attrib = manifest.entryAttributes.get(key);
 				Iterator<?> entries = attrib.keySet().iterator();
 				while (entries.hasNext()) {
 					Attributes.Name name = (Attributes.Name) entries.next();
@@ -266,7 +273,7 @@
 	}
 
 	/**
-	 * Contructs a new Manifest instance obtaining Attribute information from
+	 * Constructs a new Manifest instance obtaining Attribute information from
 	 * the parameter InputStream.
 	 * 
 	 * @param is
@@ -299,17 +306,20 @@
 	 *         <code>false</code> otherwise
 	 */
 	public boolean equals(Object o) {
-		if (o == null)
-			return false;
-		if (o.getClass() != this.getClass())
-			return false;
-		if (!mainAttributes.equals(((Manifest) o).mainAttributes))
-			return false;
+		if (o == null) {
+            return false;
+        }
+		if (o.getClass() != this.getClass()) {
+            return false;
+        }
+		if (!mainAttributes.equals(((Manifest) o).mainAttributes)) {
+            return false;
+        }
 		return entryAttributes.equals(((Manifest) o).entryAttributes);
 	}
 
 	byte[] getChunk(String name) {
-		return (byte[]) chunks.get(name);
+		return chunks.get(name);
 	}
 
 	void removeChunks() {



Mime
View raw message