harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjanu...@apache.org
Subject svn commit: r647100 [6/9] - in /harmony/enhanced/classlib/trunk/modules/pack200/src: main/java/org/apache/harmony/pack200/ main/java/org/apache/harmony/pack200/bytecode/ main/java/org/apache/harmony/pack200/bytecode/forms/ test/java/org/apache/harmony/...
Date Fri, 11 Apr 2008 10:10:00 GMT
Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPNameAndType.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPNameAndType.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPNameAndType.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPNameAndType.java Fri Apr 11 03:09:38 2008
@@ -26,89 +26,89 @@
  */
 public class CPNameAndType extends ConstantPoolEntry {
 
-	CPUTF8 descriptor;
+    CPUTF8 descriptor;
 
-	transient int descriptorIndex;
+    transient int descriptorIndex;
 
-	CPUTF8 name;
+    CPUTF8 name;
 
-	transient int nameIndex;
+    transient int nameIndex;
 
-	/**
-	 * Create a new CPNameAndType
-	 * @param name
-	 * @param descriptor
-	 * @param domain
-	 * @throws NullPointerException if name or descriptor is null
-	 */
-	public CPNameAndType(CPUTF8 name, CPUTF8 descriptor, int domain) {
-		super(ConstantPoolEntry.CP_NameAndType);
-		this.name = name;
-		this.descriptor = descriptor;
+    /**
+     * Create a new CPNameAndType
+     * 
+     * @param name
+     * @param descriptor
+     * @param domain
+     * @throws NullPointerException
+     *             if name or descriptor is null
+     */
+    public CPNameAndType(CPUTF8 name, CPUTF8 descriptor, int domain) {
+        super(ConstantPoolEntry.CP_NameAndType);
+        this.name = name;
+        this.descriptor = descriptor;
         this.domain = domain;
-        if(name == null || descriptor == null) {
+        if (name == null || descriptor == null) {
             throw new NullPointerException("Null arguments are not allowed");
         }
-	}
+    }
 
-	protected ClassFileEntry[] getNestedClassFileEntries() {
-		return new ClassFileEntry[] { name, descriptor };
-	}
-
-	protected void resolve(ClassConstantPool pool) {
-		super.resolve(pool);
-		descriptorIndex = pool.indexOf(descriptor);
-		nameIndex = pool.indexOf(name);
-	}
-
-	/*
-	 * field_info { u2 access_flags; u2 name_index; u2 descriptor_index; u2
-	 * attributes_count; attribute_info attributes[attributes_count]; }
-	 */
-
-	protected void writeBody(DataOutputStream dos) throws IOException {
-		dos.writeShort(nameIndex);
-		dos.writeShort(descriptorIndex);
-	}
-
-
-	public String toString() {
-		return "NameAndType: " + name + "(" + descriptor + ")";
-	}
-
-
-	public int hashCode() {
-		final int PRIME = 31;
-		int result = 1;
-		result = PRIME * result + descriptor.hashCode();
-		result = PRIME * result + name.hashCode();
-		return result;
-	}
-
-
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-		if (obj == null)
-			return false;
-		if (getClass() != obj.getClass())
-			return false;
-		final CPNameAndType other = (CPNameAndType) obj;
-		if (!descriptor.equals(other.descriptor))
-			return false;
-		if (!name.equals(other.name))
-			return false;
-		return true;
-	}
-
-	/**
-	 * Answers the invokeinterface count argument when the
-	 * receiver is treated as an invokeinterface target.
-	 * This value is not meaningful if the receiver is not
-     * an invokeinterface target.
-	 * @return count
-	 */
-	public int invokeInterfaceCount() {
-	    return 1 + SegmentUtils.countInvokeInterfaceArgs(descriptor.underlyingString());
-	}
+    protected ClassFileEntry[] getNestedClassFileEntries() {
+        return new ClassFileEntry[] { name, descriptor };
+    }
+
+    protected void resolve(ClassConstantPool pool) {
+        super.resolve(pool);
+        descriptorIndex = pool.indexOf(descriptor);
+        nameIndex = pool.indexOf(name);
+    }
+
+    /*
+     * field_info { u2 access_flags; u2 name_index; u2 descriptor_index; u2
+     * attributes_count; attribute_info attributes[attributes_count]; }
+     */
+
+    protected void writeBody(DataOutputStream dos) throws IOException {
+        dos.writeShort(nameIndex);
+        dos.writeShort(descriptorIndex);
+    }
+
+    public String toString() {
+        return "NameAndType: " + name + "(" + descriptor + ")";
+    }
+
+    public int hashCode() {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result + descriptor.hashCode();
+        result = PRIME * result + name.hashCode();
+        return result;
+    }
+
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        final CPNameAndType other = (CPNameAndType) obj;
+        if (!descriptor.equals(other.descriptor))
+            return false;
+        if (!name.equals(other.name))
+            return false;
+        return true;
+    }
+
+    /**
+     * Answers the invokeinterface count argument when the receiver is treated
+     * as an invokeinterface target. This value is not meaningful if the
+     * receiver is not an invokeinterface target.
+     * 
+     * @return count
+     */
+    public int invokeInterfaceCount() {
+        return 1 + SegmentUtils.countInvokeInterfaceArgs(descriptor
+                .underlyingString());
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPRef.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPRef.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPRef.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPRef.java Fri Apr 11 03:09:38 2008
@@ -20,90 +20,93 @@
 import java.io.IOException;
 
 /**
- * Abstract superclass for reference constant pool entries, such as a method or field
- * reference.
+ * Abstract superclass for reference constant pool entries, such as a method or
+ * field reference.
  */
 public abstract class CPRef extends ConstantPoolEntry {
 
-	CPClass className;
-	transient int classNameIndex;
+    CPClass className;
+    transient int classNameIndex;
 
-	protected CPNameAndType nameAndType;
-	transient int nameAndTypeIndex;
+    protected CPNameAndType nameAndType;
+    transient int nameAndTypeIndex;
 
     /**
-	 * Create a new CPRef
-	 * @param type
-	 * @param className
-	 * @param descriptor
-	 * @throws NullPointerException if descriptor or className is null
-	 */
-	public CPRef(byte type, CPClass className, CPNameAndType descriptor) {
-		super(type);
-		this.className = className;
-		this.nameAndType = descriptor;
-		if(descriptor == null || className == null) {
+     * Create a new CPRef
+     * 
+     * @param type
+     * @param className
+     * @param descriptor
+     * @throws NullPointerException
+     *             if descriptor or className is null
+     */
+    public CPRef(byte type, CPClass className, CPNameAndType descriptor) {
+        super(type);
+        this.className = className;
+        this.nameAndType = descriptor;
+        if (descriptor == null || className == null) {
             throw new NullPointerException("Null arguments are not allowed");
-		}
-	}
+        }
+    }
 
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-		if (obj == null)
-			return false;
-		if (getClass() != obj.getClass())
-			return false;
-		if (this.hashCode() != obj.hashCode()) {
-		    return false;
-		}
-		final CPRef other = (CPRef) obj;
-		if (!className.equals(other.className))
-			return false;
-		if (!nameAndType.equals(other.nameAndType))
-			return false;
-		return true;
-	}
-
-	protected ClassFileEntry[] getNestedClassFileEntries() {
-		ClassFileEntry[] entries = new ClassFileEntry[2];
-		entries[0] = className;
-		entries[1] = nameAndType;
-		return entries;
-	}
-
-	public int hashCode() {
-		final int PRIME = 37;
-		return (PRIME * className.hashCode()) + nameAndType.hashCode();
-	}
-
-	protected void resolve(ClassConstantPool pool) {
-		super.resolve(pool);
-		nameAndTypeIndex = pool.indexOf(nameAndType);
-		classNameIndex = pool.indexOf(className);
-	}
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        if (this.hashCode() != obj.hashCode()) {
+            return false;
+        }
+        final CPRef other = (CPRef) obj;
+        if (!className.equals(other.className))
+            return false;
+        if (!nameAndType.equals(other.nameAndType))
+            return false;
+        return true;
+    }
+
+    protected ClassFileEntry[] getNestedClassFileEntries() {
+        ClassFileEntry[] entries = new ClassFileEntry[2];
+        entries[0] = className;
+        entries[1] = nameAndType;
+        return entries;
+    }
+
+    public int hashCode() {
+        final int PRIME = 37;
+        return (PRIME * className.hashCode()) + nameAndType.hashCode();
+    }
+
+    protected void resolve(ClassConstantPool pool) {
+        super.resolve(pool);
+        nameAndTypeIndex = pool.indexOf(nameAndType);
+        classNameIndex = pool.indexOf(className);
+    }
 
     protected String cachedToString = null;
-	public String toString() {
-	    if(cachedToString == null) {
-	        String type;
-	        if (getTag() == ConstantPoolEntry.CP_Fieldref) {
-	            type = "FieldRef"; //$NON-NLS-1$
-	        } else if (getTag() == ConstantPoolEntry.CP_Methodref) {
-	            type = "MethoddRef"; //$NON-NLS-1$
-	        } else if (getTag() == ConstantPoolEntry.CP_InterfaceMethodref) {
-	            type = "InterfaceMethodRef"; //$NON-NLS-1$
-	        } else {
-	            type = "unknown"; //$NON-NLS-1$
-	        }
-	        cachedToString = type + ": " + className + "#" + nameAndType; //$NON-NLS-1$ //$NON-NLS-2$
-	    }
-		return cachedToString;
-	}
-
-	protected void writeBody(DataOutputStream dos) throws IOException {
-		dos.writeShort(classNameIndex);
-		dos.writeShort(nameAndTypeIndex);
-	}
+
+    public String toString() {
+        if (cachedToString == null) {
+            String type;
+            if (getTag() == ConstantPoolEntry.CP_Fieldref) {
+                type = "FieldRef"; //$NON-NLS-1$
+            } else if (getTag() == ConstantPoolEntry.CP_Methodref) {
+                type = "MethoddRef"; //$NON-NLS-1$
+            } else if (getTag() == ConstantPoolEntry.CP_InterfaceMethodref) {
+                type = "InterfaceMethodRef"; //$NON-NLS-1$
+            } else {
+                type = "unknown"; //$NON-NLS-1$
+            }
+            cachedToString = type + ": " + className + "#" + nameAndType; //$NON-NLS-1$ //$NON-NLS-2$
+        }
+        return cachedToString;
+    }
+
+    protected void writeBody(DataOutputStream dos) throws IOException {
+        dos.writeShort(classNameIndex);
+        dos.writeShort(nameAndTypeIndex);
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPString.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPString.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPString.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPString.java Fri Apr 11 03:09:38 2008
@@ -25,34 +25,33 @@
 public class CPString extends CPConstant {
 
     private transient int nameIndex;
-	private final CPUTF8 name;
+    private final CPUTF8 name;
 
     public CPString(CPUTF8 value) {
-		super(ConstantPoolEntry.CP_String, value);
-		this.domain = ClassConstantPool.DOMAIN_STRING;
-		this.name = value;
-	}
+        super(ConstantPoolEntry.CP_String, value);
+        this.domain = ClassConstantPool.DOMAIN_STRING;
+        this.name = value;
+    }
 
     protected void writeBody(DataOutputStream dos) throws IOException {
-		dos.writeShort(nameIndex);
-	}
+        dos.writeShort(nameIndex);
+    }
 
-
-	public String toString() {
-		return "String: " + getValue();
-	}
-
-	/**
-	 * Allows the constant pool entries to resolve their nested entries
-	 *
-	 * @param pool
-	 */
-	protected void resolve(ClassConstantPool pool) {
-		super.resolve(pool);
-		nameIndex = pool.indexOf(name);
-	}
-
-	protected ClassFileEntry[] getNestedClassFileEntries() {
-		return new ClassFileEntry[] { name };
- 	}
+    public String toString() {
+        return "String: " + getValue();
+    }
+
+    /**
+     * Allows the constant pool entries to resolve their nested entries
+     * 
+     * @param pool
+     */
+    protected void resolve(ClassConstantPool pool) {
+        super.resolve(pool);
+        nameIndex = pool.indexOf(name);
+    }
+
+    protected ClassFileEntry[] getNestedClassFileEntries() {
+        return new ClassFileEntry[] { name };
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPUTF8.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPUTF8.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPUTF8.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPUTF8.java Fri Apr 11 03:09:38 2008
@@ -29,56 +29,58 @@
 
     /**
      * Creates a new CPUTF8 instance
+     * 
      * @param utf8
      * @param domain
-     * @throws NullPointerException if utf8 is null
+     * @throws NullPointerException
+     *             if utf8 is null
      */
     public CPUTF8(String utf8, int domain) {
-		super(ConstantPoolEntry.CP_UTF8);
-		this.utf8 = utf8;
-		this.domain = domain;
-        if(domain == ClassConstantPool.DOMAIN_UNDEFINED) {
+        super(ConstantPoolEntry.CP_UTF8);
+        this.utf8 = utf8;
+        this.domain = domain;
+        if (domain == ClassConstantPool.DOMAIN_UNDEFINED) {
             throw new RuntimeException();
         }
-        if(utf8 == null) {
+        if (utf8 == null) {
             throw new NullPointerException("Null arguments are not allowed");
         }
-	}
+    }
 
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-		if (obj == null)
-			return false;
-		if (this.getClass() != obj.getClass())
-			return false;
-		final CPUTF8 other = (CPUTF8) obj;
-		return utf8.equals(other.utf8);
-	}
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (this.getClass() != obj.getClass())
+            return false;
+        final CPUTF8 other = (CPUTF8) obj;
+        return utf8.equals(other.utf8);
+    }
 
-	public int hashCode() {
-		final int PRIME = 31;
-		return PRIME + utf8.hashCode();
-	}
+    public int hashCode() {
+        final int PRIME = 31;
+        return PRIME + utf8.hashCode();
+    }
 
-	public String toString() {
-		return "UTF8: " + utf8;
-	}
+    public String toString() {
+        return "UTF8: " + utf8;
+    }
 
-	protected void writeBody(DataOutputStream dos) throws IOException {
-		byte[] bytes;
-		try {
-			// TODO Check that this is the right UTF-8 for bytes
-			bytes = utf8.getBytes("UTF-8");
-		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Couldn't convert string " + utf8
-					+ " to UTF-8");
-		}
-		dos.writeShort(bytes.length);
-		dos.write(bytes);
-	}
+    protected void writeBody(DataOutputStream dos) throws IOException {
+        byte[] bytes;
+        try {
+            // TODO Check that this is the right UTF-8 for bytes
+            bytes = utf8.getBytes("UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException("Couldn't convert string " + utf8
+                    + " to UTF-8");
+        }
+        dos.writeShort(bytes.length);
+        dos.write(bytes);
+    }
 
-	public String underlyingString() {
-	    return utf8;
-	}
+    public String underlyingString() {
+        return utf8;
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ClassConstantPool.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ClassConstantPool.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ClassConstantPool.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ClassConstantPool.java Fri Apr 11 03:09:38 2008
@@ -54,6 +54,7 @@
     public String toString() {
         return entries.toString();
     }
+
     private final List others = new ArrayList(500);
     private List entries = new ArrayList(500);
 
@@ -63,31 +64,34 @@
         // We don't want duplicates.
         // Only add in constant pools, but resolve all types since they may
         // introduce new constant pool entries
-// This is a handy way to see what's adding a ClassFileEntry - set a breakpoint on the print
-//      if(entry instanceof CPLong) {
-//          org.apache.harmony.pack200.SegmentUtils.debug("AAH:" + ((CPUTF8)entry).underlyingString());
-//          if (((CPUTF8)entry).underlyingString().indexOf('\b') != -1) {
-//          boolean halt = false;
-//          for(int index=0; index < entries.size(); index++) {
-//              ClassFileEntry foo = (ClassFileEntry)(entries.get(index));
-//              if(foo instanceof CPUTF8) {
-//                 if(((CPUTF8)foo).underlyingString().matches(".*MRUBundleFileList.java.*"))  {
-//                      halt = true;
-//                  }
-//
-//              }
-//          }
-//      }
+        // This is a handy way to see what's adding a ClassFileEntry - set a
+        // breakpoint on the print
+        // if(entry instanceof CPLong) {
+        // org.apache.harmony.pack200.SegmentUtils.debug("AAH:" +
+        // ((CPUTF8)entry).underlyingString());
+        // if (((CPUTF8)entry).underlyingString().indexOf('\b') != -1) {
+        // boolean halt = false;
+        // for(int index=0; index < entries.size(); index++) {
+        // ClassFileEntry foo = (ClassFileEntry)(entries.get(index));
+        // if(foo instanceof CPUTF8) {
+        // if(((CPUTF8)foo).underlyingString().matches(".*MRUBundleFileList.java.*"))
+        // {
+        // halt = true;
+        // }
+        //
+        // }
+        // }
+        // }
         if (entry instanceof ConstantPoolEntry) {
-          if (!entriesContainsSet.contains(entry)) {
+            if (!entriesContainsSet.contains(entry)) {
                 entriesContainsSet.add(entry);
                 entries.add(entry);
             }
         } else {
-          if (!othersContainsSet.contains(entry)) {
+            if (!othersContainsSet.contains(entry)) {
                 othersContainsSet.add(entry);
                 others.add(entry);
-          }
+            }
 
         }
         ClassFileEntry[] nestedEntries = entry.getNestedClassFileEntries();
@@ -99,9 +103,9 @@
 
     protected void initializeIndexCache() {
         indexCache = new HashMap();
-        for(int index=0; index < entries.size(); index++) {
-            ClassFileEntry indexEntry = (ClassFileEntry)entries.get(index);
-            if(indexCache.containsKey(indexEntry)) {
+        for (int index = 0; index < entries.size(); index++) {
+            ClassFileEntry indexEntry = (ClassFileEntry) entries.get(index);
+            if (indexCache.containsKey(indexEntry)) {
                 // key is already in there - do nothing
                 // This will happen if a long or double
                 // is the entry - they take up 2 slots.
@@ -113,13 +117,14 @@
 
     public int indexOf(ClassFileEntry entry) {
         if (!resolved)
-            throw new IllegalStateException("Constant pool is not yet resolved; this does not make any sense");
-        if(null == indexCache) {
+            throw new IllegalStateException(
+                    "Constant pool is not yet resolved; this does not make any sense");
+        if (null == indexCache) {
             initializeIndexCache();
         }
-        Integer entryIndex = ((Integer)indexCache.get(entry));
+        Integer entryIndex = ((Integer) indexCache.get(entry));
         // If the entry isn't found, answer -1. Otherwise answer the entry.
-        if(entryIndex != null) {
+        if (entryIndex != null) {
             return entryIndex.intValue() + 1;
         }
         return -1;
@@ -131,43 +136,43 @@
 
     public ClassFileEntry get(int i) {
         if (!resolved)
-            throw new IllegalStateException("Constant pool is not yet resolved; this does not make any sense");
+            throw new IllegalStateException(
+                    "Constant pool is not yet resolved; this does not make any sense");
         return (ClassFileEntry) entries.get(--i);
     }
 
     public void resolve(Segment segment) {
         Iterator it;
-      resolved= true;
-      it = entries.iterator();
-      while (it.hasNext()) {
-          ClassFileEntry entry = (ClassFileEntry) it.next();
-          entry.resolve(this);
-      }
-      it = others.iterator();
-      while (it.hasNext()) {
-          ClassFileEntry entry = (ClassFileEntry) it.next();
-          entry.resolve(this);
-      }
+        resolved = true;
+        it = entries.iterator();
+        while (it.hasNext()) {
+            ClassFileEntry entry = (ClassFileEntry) it.next();
+            entry.resolve(this);
+        }
+        it = others.iterator();
+        while (it.hasNext()) {
+            ClassFileEntry entry = (ClassFileEntry) it.next();
+            entry.resolve(this);
+        }
 
-      sortClassPool(segment);
+        sortClassPool(segment);
     }
 
     /**
-     * Answer the collection of CPClasses currently held
-     * by the ClassPoolSet. This is used to calculate relevant
-     * classes when generating the set of relevant inner
-     * classes (ic_relevant())
+     * Answer the collection of CPClasses currently held by the ClassPoolSet.
+     * This is used to calculate relevant classes when generating the set of
+     * relevant inner classes (ic_relevant())
+     * 
      * @return ArrayList collection of all classes.
-     *
-     * NOTE: when this list is answered, the classes may not
-     * yet be resolved.
+     * 
+     * NOTE: when this list is answered, the classes may not yet be resolved.
      */
     public List allClasses() {
         List classesList = new ArrayList();
         Iterator it = entries.iterator();
-        while(it.hasNext()) {
-            ConstantPoolEntry entry = (ConstantPoolEntry)it.next();
-            if(entry.getDomain() == DOMAIN_CLASSREF) {
+        while (it.hasNext()) {
+            ConstantPoolEntry entry = (ConstantPoolEntry) it.next();
+            if (entry.getDomain() == DOMAIN_CLASSREF) {
                 classesList.add(entry);
             }
         }
@@ -186,9 +191,9 @@
         Iterator it = entries.iterator();
         ArrayList startOfPool = new ArrayList();
         ArrayList finalSort = new ArrayList();
-        while(it.hasNext()) {
-            ClassFileEntry nextEntry = (ClassFileEntry)it.next();
-            if(nextEntry.mustStartClassPool()) {
+        while (it.hasNext()) {
+            ClassFileEntry nextEntry = (ClassFileEntry) it.next();
+            if (nextEntry.mustStartClassPool()) {
                 startOfPool.add(nextEntry);
             } else {
                 finalSort.add(nextEntry);
@@ -196,18 +201,18 @@
         }
         entries = new ArrayList(entries.size());
         Iterator itStart = startOfPool.iterator();
-        while(itStart.hasNext()) {
+        while (itStart.hasNext()) {
             ClassFileEntry entry = (ClassFileEntry) itStart.next();
             entries.add(entry);
-            if (entry instanceof CPLong ||entry instanceof CPDouble)
-                entries.add(entry); //these get 2 slots because of their size
+            if (entry instanceof CPLong || entry instanceof CPDouble)
+                entries.add(entry); // these get 2 slots because of their size
         }
         it = finalSort.iterator();
-        while(it.hasNext()) {
+        while (it.hasNext()) {
             ClassFileEntry entry = (ClassFileEntry) it.next();
             entries.add(entry);
-            if (entry instanceof CPLong ||entry instanceof CPDouble)
-                entries.add(entry); //these get 2 slots because of their size
+            if (entry instanceof CPLong || entry instanceof CPDouble)
+                entries.add(entry); // these get 2 slots because of their size
         }
 
         // Since we resorted, need to initialize index cache
@@ -217,14 +222,14 @@
         // to re-resolve to update references. This should
         // not add any new entries this time through.
         it = entries.iterator();
-        while(it.hasNext()) {
-            ClassFileEntry entry = (ClassFileEntry)it.next();
+        while (it.hasNext()) {
+            ClassFileEntry entry = (ClassFileEntry) it.next();
             entry.resolve(this);
         }
         // Also need to re-resolve the others.
         it = others.iterator();
-        while(it.hasNext()) {
-            ClassFileEntry entry = (ClassFileEntry)it.next();
+        while (it.hasNext()) {
+            ClassFileEntry entry = (ClassFileEntry) it.next();
             entry.resolve(this);
         }
     }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ClassFile.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ClassFile.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ClassFile.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ClassFile.java Fri Apr 11 03:09:38 2008
@@ -24,47 +24,51 @@
  */
 public class ClassFile {
 
-	public int major;
-	public int minor;
-	private final int magic = 0xCAFEBABE;
-	public ClassConstantPool pool = new ClassConstantPool();
-	public int accessFlags;
-	public int thisClass;
-	public int superClass;
-	public int[] interfaces;
-	public ClassFileEntry[] fields;
-	public ClassFileEntry[] methods;
-	public Attribute[] attributes;
-	public void write(DataOutputStream dos) throws IOException {
-		dos.writeInt(magic);
-		dos.writeShort(minor);
-		dos.writeShort(major);
-		dos.writeShort(pool.size()+1);
-		for(int i=1;i<=pool.size();i++) {
-			ConstantPoolEntry entry;
-			(entry = (ConstantPoolEntry)pool.get(i)).doWrite(dos);
-			// Doubles and longs take up two spaces in the pool, but only one gets written
-			if (entry.getTag() == ConstantPoolEntry.CP_Double || entry.getTag() == ConstantPoolEntry.CP_Long)
-				i++;
-		};
-		dos.writeShort(accessFlags);
-		dos.writeShort(thisClass);
-		dos.writeShort(superClass);
-		dos.writeShort(interfaces.length);
-		for(int i=0;i<interfaces.length;i++) {
-			dos.writeShort(interfaces[i]);
-		}
-		dos.writeShort(fields.length);
-		for(int i=0;i<fields.length;i++) {
-			fields[i].write(dos);
-		}
-		dos.writeShort(methods.length);
-        for(int i=0;i<methods.length;i++) {
-			methods[i].write(dos);
-		}
-		dos.writeShort(attributes.length);
-		for(int i=0;i<attributes.length;i++) {
-			attributes[i].write(dos);
-		}
-	}
+    public int major;
+    public int minor;
+    private final int magic = 0xCAFEBABE;
+    public ClassConstantPool pool = new ClassConstantPool();
+    public int accessFlags;
+    public int thisClass;
+    public int superClass;
+    public int[] interfaces;
+    public ClassFileEntry[] fields;
+    public ClassFileEntry[] methods;
+    public Attribute[] attributes;
+
+    public void write(DataOutputStream dos) throws IOException {
+        dos.writeInt(magic);
+        dos.writeShort(minor);
+        dos.writeShort(major);
+        dos.writeShort(pool.size() + 1);
+        for (int i = 1; i <= pool.size(); i++) {
+            ConstantPoolEntry entry;
+            (entry = (ConstantPoolEntry) pool.get(i)).doWrite(dos);
+            // Doubles and longs take up two spaces in the pool, but only one
+            // gets written
+            if (entry.getTag() == ConstantPoolEntry.CP_Double
+                    || entry.getTag() == ConstantPoolEntry.CP_Long)
+                i++;
+        }
+        ;
+        dos.writeShort(accessFlags);
+        dos.writeShort(thisClass);
+        dos.writeShort(superClass);
+        dos.writeShort(interfaces.length);
+        for (int i = 0; i < interfaces.length; i++) {
+            dos.writeShort(interfaces[i]);
+        }
+        dos.writeShort(fields.length);
+        for (int i = 0; i < fields.length; i++) {
+            fields[i].write(dos);
+        }
+        dos.writeShort(methods.length);
+        for (int i = 0; i < methods.length; i++) {
+            methods[i].write(dos);
+        }
+        dos.writeShort(attributes.length);
+        for (int i = 0; i < attributes.length; i++) {
+            attributes[i].write(dos);
+        }
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ClassFileEntry.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ClassFileEntry.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ClassFileEntry.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ClassFileEntry.java Fri Apr 11 03:09:38 2008
@@ -24,47 +24,46 @@
  */
 public abstract class ClassFileEntry {
 
-	protected static final ClassFileEntry[] NONE = new ClassFileEntry[0];
-	private boolean resolved;
+    protected static final ClassFileEntry[] NONE = new ClassFileEntry[0];
+    private boolean resolved;
 
-	protected abstract void doWrite(DataOutputStream dos) throws IOException;
+    protected abstract void doWrite(DataOutputStream dos) throws IOException;
 
-	public abstract boolean equals(Object arg0);
+    public abstract boolean equals(Object arg0);
 
-	protected ClassFileEntry[] getNestedClassFileEntries() {
-		return NONE;
-	}
-
-	public abstract int hashCode();
-
-	/**
-	 * Allows the constant pool entries to resolve their nested entries
-	 *
-	 * @param pool
-	 */
-	protected void resolve(ClassConstantPool pool) {
-		resolved = true;
-	}
-
-	protected boolean isResolved() {
-	    return resolved;
-	}
-
-	public abstract String toString();
-
-	public final void write(DataOutputStream dos) throws IOException {
-		if (!resolved)
-			throw new IllegalStateException("Entry has not been resolved");
-		doWrite(dos);
-	}
+    protected ClassFileEntry[] getNestedClassFileEntries() {
+        return NONE;
+    }
+
+    public abstract int hashCode();
+
+    /**
+     * Allows the constant pool entries to resolve their nested entries
+     * 
+     * @param pool
+     */
+    protected void resolve(ClassConstantPool pool) {
+        resolved = true;
+    }
+
+    protected boolean isResolved() {
+        return resolved;
+    }
+
+    public abstract String toString();
+
+    public final void write(DataOutputStream dos) throws IOException {
+        if (!resolved)
+            throw new IllegalStateException("Entry has not been resolved");
+        doWrite(dos);
+    }
 
     /**
-     * Answer true if the receiver must be at the beginning
-     * of the class pool (because it is the target of a
-     * single-byte ldc command). Otherwise answer false.
-     *
-     * @return boolean true if the receiver must be under
-     *   256; otherwise false.
+     * Answer true if the receiver must be at the beginning of the class pool
+     * (because it is the target of a single-byte ldc command). Otherwise answer
+     * false.
+     * 
+     * @return boolean true if the receiver must be under 256; otherwise false.
      */
     public boolean mustStartClassPool() {
         return false;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CodeAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CodeAttribute.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CodeAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CodeAttribute.java Fri Apr 11 03:09:38 2008
@@ -34,7 +34,8 @@
     public List exceptionTable; // of ExceptionTableEntry
     public int maxLocals;
     public int maxStack;
-    private static final CPUTF8 attributeName = new CPUTF8("Code", ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ);
+    private static final CPUTF8 attributeName = new CPUTF8("Code",
+            ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ);
 
     public CodeAttribute(int maxStack, int maxLocals, byte codePacked[],
             Segment segment, OperandManager operandManager, List exceptionTable) {
@@ -70,7 +71,7 @@
                 byteCodeOffsets.add(new Integer(lastBytecodePosition
                         + byteCode.getLength()));
             }
-            if(byteCode.getOpcode() == 0xC4) {
+            if (byteCode.getOpcode() == 0xC4) {
                 // Special processing for wide bytecode - it knows what its
                 // instruction is from the opcode manager, so ignore the
                 // next instruction
@@ -82,7 +83,7 @@
         // At this point, byteCodes may be a different size than
         // codePacked because of wide bytecodes.
         for (int i = 0; i < byteCodes.size(); i++) {
-            ByteCode byteCode = (ByteCode)byteCodes.get(i);
+            ByteCode byteCode = (ByteCode) byteCodes.get(i);
             byteCode.applyByteCodeTargetFixup(this);
         }
     }
@@ -110,7 +111,7 @@
             // If the catch type is null, this is a finally
             // block. If it's not null, we need to add the
             // CPClass to the list of nested class file entries.
-            if(catchType != null) {
+            if (catchType != null) {
                 nestedEntries.add(catchType);
             }
         }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ConstantPoolEntry.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ConstantPoolEntry.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ConstantPoolEntry.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ConstantPoolEntry.java Fri Apr 11 03:09:38 2008
@@ -23,83 +23,85 @@
  * Abstract superclass for constant pool entries
  */
 public abstract class ConstantPoolEntry extends ClassFileEntry {
-	public static final byte CP_Class = 7;
 
-	public static final byte CP_Double = 6;
+    public static final byte CP_Class = 7;
 
-	public static final byte CP_Fieldref = 9;
+    public static final byte CP_Double = 6;
 
-	public static final byte CP_Float = 4;
+    public static final byte CP_Fieldref = 9;
 
-	public static final byte CP_Integer = 3;
+    public static final byte CP_Float = 4;
 
-	/*
-	 * class MemberRef extends ConstantPoolEntry { private int index;
-	 *
-	 * Class(String name) { super(CP_Class); index = pool.indexOf(name); }
-	 *
-	 * void writeBody(DataOutputStream dos) throws IOException {
-	 * dos.writeShort(index); } }
-	 */
+    public static final byte CP_Integer = 3;
 
-	public static final byte CP_InterfaceMethodref = 11;
+    /*
+     * class MemberRef extends ConstantPoolEntry { private int index;
+     * Class(String name) { super(CP_Class); index = pool.indexOf(name); } void
+     * writeBody(DataOutputStream dos) throws IOException {
+     * dos.writeShort(index); } }
+     */
+
+    public static final byte CP_InterfaceMethodref = 11;
 
-	public static final byte CP_Long = 5;
+    public static final byte CP_Long = 5;
 
-	public static final byte CP_Methodref = 10;
+    public static final byte CP_Methodref = 10;
 
-	public static final byte CP_NameAndType = 12;
+    public static final byte CP_NameAndType = 12;
 
-	public static final byte CP_String = 8;
+    public static final byte CP_String = 8;
 
-	public static final byte CP_UTF8 = 1;
+    public static final byte CP_UTF8 = 1;
 
-	byte tag;
+    byte tag;
 
-	protected int domain = ClassConstantPool.DOMAIN_UNDEFINED;
+    protected int domain = ClassConstantPool.DOMAIN_UNDEFINED;
+
+    ConstantPoolEntry(byte tag) {
+        this.tag = tag;
+    }
 
-	ConstantPoolEntry(byte tag) {
-		this.tag = tag;
-	}
+    public abstract boolean equals(Object obj);
 
-	public abstract boolean equals(Object obj);
+    public byte getTag() {
+        return tag;
+    }
 
-	public byte getTag() {
-		return tag;
-	}
+    public int getDomain() {
+        return domain;
+    }
 
-	public int getDomain() {
-	    return domain;
-	}
+    public void setDomain(int newDomain) {
+        this.domain = newDomain;
+    }
 
-	public void setDomain(int newDomain) {
-	    this.domain = newDomain;
-	}
+    public abstract int hashCode();
 
-	public abstract int hashCode();
+    public void doWrite(DataOutputStream dos) throws IOException {
+        dos.writeByte(tag);
+        writeBody(dos);
+    }
 
-	public void doWrite(DataOutputStream dos) throws IOException {
-		dos.writeByte(tag);
-		writeBody(dos);
-	}
+    protected abstract void writeBody(DataOutputStream dos) throws IOException;
 
-	protected abstract void writeBody(DataOutputStream dos) throws IOException;
+    private boolean mustStartClassPool = false;
 
-	private boolean mustStartClassPool = false;
     /**
-     * Set whether the receiver must be at the start of the
-     * class pool. Anything which is the target of a single-
-     * byte ldc (bytecode 18) command must be at the start
-     * of the class pool.
-     *
-     * @param b boolean true if the receiver must be at
-     * the start of the class pool, otherwise false.
+     * Set whether the receiver must be at the start of the class pool. Anything
+     * which is the target of a single- byte ldc (bytecode 18) command must be
+     * at the start of the class pool.
+     * 
+     * @param b
+     *            boolean true if the receiver must be at the start of the class
+     *            pool, otherwise false.
      */
     public void mustStartClassPool(boolean b) {
         mustStartClassPool = b;
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.harmony.pack200.bytecode.ClassFileEntry#mustStartClassPool()
      */
     public boolean mustStartClassPool() {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ConstantValueAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ConstantValueAttribute.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ConstantValueAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ConstantValueAttribute.java Fri Apr 11 03:09:38 2008
@@ -26,65 +26,62 @@
 
     private int constantIndex;
 
-	private final ClassFileEntry entry;
+    private final ClassFileEntry entry;
 
     private static final CPUTF8 attributeName = new CPUTF8(
             "ConstantValue", ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ); //$NON-NLS-1$
 
-	public ConstantValueAttribute(ClassFileEntry entry) {
-		super(attributeName);
-        if(entry == null) {
+    public ConstantValueAttribute(ClassFileEntry entry) {
+        super(attributeName);
+        if (entry == null) {
             throw new NullPointerException();
         }
-		this.entry = entry;
-	}
+        this.entry = entry;
+    }
 
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-		if (!super.equals(obj))
-			return false;
-		if (this.getClass() != obj.getClass())
-			return false;
-		final ConstantValueAttribute other = (ConstantValueAttribute) obj;
-		if (entry == null) {
-			if (other.entry != null)
-				return false;
-		} else if (!entry.equals(other.entry))
-			return false;
-		return true;
-	}
-
-
-	protected int getLength() {
-		return 2;
-	}
-
-	protected ClassFileEntry[] getNestedClassFileEntries() {
-		return new ClassFileEntry[] { getAttributeName(), entry };
-	}
-
-
-	public int hashCode() {
-		final int PRIME = 31;
-		int result = super.hashCode();
-		result = PRIME * result + ((entry == null) ? 0 : entry.hashCode());
-		return result;
-	}
-
-	protected void resolve(ClassConstantPool pool) {
-		super.resolve(pool);
-		entry.resolve(pool);
-		this.constantIndex = pool.indexOf(entry);
-	}
-
-	public String toString() {
-		return "Constant:" + entry;
-	}
-
-
-	protected void writeBody(DataOutputStream dos) throws IOException {
-		dos.writeShort(constantIndex);
-	}
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (!super.equals(obj))
+            return false;
+        if (this.getClass() != obj.getClass())
+            return false;
+        final ConstantValueAttribute other = (ConstantValueAttribute) obj;
+        if (entry == null) {
+            if (other.entry != null)
+                return false;
+        } else if (!entry.equals(other.entry))
+            return false;
+        return true;
+    }
+
+    protected int getLength() {
+        return 2;
+    }
+
+    protected ClassFileEntry[] getNestedClassFileEntries() {
+        return new ClassFileEntry[] { getAttributeName(), entry };
+    }
+
+    public int hashCode() {
+        final int PRIME = 31;
+        int result = super.hashCode();
+        result = PRIME * result + ((entry == null) ? 0 : entry.hashCode());
+        return result;
+    }
+
+    protected void resolve(ClassConstantPool pool) {
+        super.resolve(pool);
+        entry.resolve(pool);
+        this.constantIndex = pool.indexOf(entry);
+    }
+
+    public String toString() {
+        return "Constant:" + entry;
+    }
+
+    protected void writeBody(DataOutputStream dos) throws IOException {
+        dos.writeShort(constantIndex);
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/DeprecatedAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/DeprecatedAttribute.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/DeprecatedAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/DeprecatedAttribute.java Fri Apr 11 03:09:38 2008
@@ -24,27 +24,34 @@
  */
 public class DeprecatedAttribute extends Attribute {
 
-    private static final CPUTF8 attributeName = new CPUTF8("Deprecated", ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ);
+    private static final CPUTF8 attributeName = new CPUTF8("Deprecated",
+            ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ);
 
     public DeprecatedAttribute() {
         super(attributeName);
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.harmony.pack200.bytecode.Attribute#getLength()
      */
     protected int getLength() {
         return 0;
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.harmony.pack200.bytecode.Attribute#writeBody(java.io.DataOutputStream)
      */
     protected void writeBody(DataOutputStream dos) throws IOException {
         // No body
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.harmony.pack200.bytecode.ClassFileEntry#toString()
      */
     public String toString() {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/EnclosingMethodAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/EnclosingMethodAttribute.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/EnclosingMethodAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/EnclosingMethodAttribute.java Fri Apr 11 03:09:38 2008
@@ -37,7 +37,9 @@
         this.method = method;
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.harmony.pack200.bytecode.Attribute#getLength()
      */
     protected int getLength() {
@@ -52,7 +54,9 @@
         method_index = pool.indexOf(method);
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.harmony.pack200.bytecode.Attribute#writeBody(java.io.DataOutputStream)
      */
     protected void writeBody(DataOutputStream dos) throws IOException {
@@ -60,7 +64,9 @@
         dos.writeShort(method_index);
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.harmony.pack200.bytecode.ClassFileEntry#toString()
      */
     public String toString() {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ExceptionTableEntry.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ExceptionTableEntry.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ExceptionTableEntry.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ExceptionTableEntry.java Fri Apr 11 03:09:38 2008
@@ -36,41 +36,47 @@
     private int catchTypeIndex;
 
     /**
-     * Create a new ExceptionTableEntry. Exception tables are
-     * of two kinds: either a normal one (with a Throwable as
-     * the catch_type) or a finally clause (which has no
-     * catch_type). In the class file, the finally clause is
-     * represented as catch_type == 0.
-     *
-     * To create a finally clause with this method, pass in
-     * null for the catchType.
-     *
-     * @param startPC int
-     * @param endPC int
-     * @param handlerPC int
-     * @param catchType CPClass (if it's a normal catch) or null
-     *  (if it's a finally clause).
+     * Create a new ExceptionTableEntry. Exception tables are of two kinds:
+     * either a normal one (with a Throwable as the catch_type) or a finally
+     * clause (which has no catch_type). In the class file, the finally clause
+     * is represented as catch_type == 0.
+     * 
+     * To create a finally clause with this method, pass in null for the
+     * catchType.
+     * 
+     * @param startPC
+     *            int
+     * @param endPC
+     *            int
+     * @param handlerPC
+     *            int
+     * @param catchType
+     *            CPClass (if it's a normal catch) or null (if it's a finally
+     *            clause).
      */
-    public ExceptionTableEntry(int startPC, int endPC, int handlerPC, CPClass catchType) {
+    public ExceptionTableEntry(int startPC, int endPC, int handlerPC,
+            CPClass catchType) {
         this.startPC = startPC;
         this.endPC = endPC;
         this.handlerPC = handlerPC;
         this.catchType = catchType;
     }
 
-	public void write(DataOutputStream dos) throws IOException {
-		dos.writeShort(startPcRenumbered);
-		dos.writeShort(endPcRenumbered);
-		dos.writeShort(handlerPcRenumbered);
-		dos.writeShort(catchTypeIndex);
-	}
+    public void write(DataOutputStream dos) throws IOException {
+        dos.writeShort(startPcRenumbered);
+        dos.writeShort(endPcRenumbered);
+        dos.writeShort(handlerPcRenumbered);
+        dos.writeShort(catchTypeIndex);
+    }
 
     public void renumber(List byteCodeOffsets) {
-        startPcRenumbered = ((Integer)byteCodeOffsets.get(startPC)).intValue();
+        startPcRenumbered = ((Integer) byteCodeOffsets.get(startPC)).intValue();
         int endPcIndex = startPC + endPC;
-        endPcRenumbered = ((Integer)byteCodeOffsets.get(endPcIndex)).intValue();
+        endPcRenumbered = ((Integer) byteCodeOffsets.get(endPcIndex))
+                .intValue();
         int handlerPcIndex = endPcIndex + handlerPC;
-        handlerPcRenumbered = ((Integer)byteCodeOffsets.get(handlerPcIndex)).intValue();
+        handlerPcRenumbered = ((Integer) byteCodeOffsets.get(handlerPcIndex))
+                .intValue();
     }
 
     public CPClass getCatchType() {
@@ -78,7 +84,7 @@
     }
 
     public void resolve(ClassConstantPool pool) {
-        if(catchType == null) {
+        if (catchType == null) {
             // If the catch type is a finally clause
             // the index is always 0.
             catchTypeIndex = 0;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ExceptionsAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ExceptionsAttribute.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ExceptionsAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ExceptionsAttribute.java Fri Apr 11 03:09:38 2008
@@ -28,78 +28,78 @@
     private static final CPUTF8 attributeName = new CPUTF8(
             "Exceptions", ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ); //$NON-NLS-1$
 
-	private static int hashCode(Object[] array) {
-		final int prime = 31;
-		if (array == null)
-			return 0;
-		int result = 1;
-		for (int index = 0; index < array.length; index++) {
-			result = prime * result
-					+ (array[index] == null ? 0 : array[index].hashCode());
-		}
-		return result;
-	}
-
-	private transient int[] exceptionIndexes;
-
-	private final CPClass[] exceptions;
-
-	public ExceptionsAttribute(CPClass[] exceptions) {
-		super(attributeName);
-		this.exceptions = exceptions;
-	}
-
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-		if (!super.equals(obj))
-			return false;
-		if (getClass() != obj.getClass())
-			return false;
-		final ExceptionsAttribute other = (ExceptionsAttribute) obj;
-		if (!Arrays.equals(exceptions, other.exceptions))
-			return false;
-		return true;
-	}
-
-	protected int getLength() {
-		return 2 + 2 * exceptions.length;
-	}
-
-	protected ClassFileEntry[] getNestedClassFileEntries() {
-		ClassFileEntry[] result = new ClassFileEntry[exceptions.length+1];
-		for (int i = 0; i < exceptions.length; i++) {
-			result[i] = exceptions[i];
-		}
-		result[exceptions.length] = getAttributeName();
-		return result;
-	}
-
-	public int hashCode() {
-		final int prime = 31;
-		int result = super.hashCode();
-		result = prime * result + ExceptionsAttribute.hashCode(exceptions);
-		return result;
-	}
-
-	protected void resolve(ClassConstantPool pool) {
-		super.resolve(pool);
-		exceptionIndexes = new int[exceptions.length];
-		for (int i = 0; i < exceptions.length; i++) {
-			exceptions[i].resolve(pool);
-			exceptionIndexes[i] = pool.indexOf(exceptions[i]);
-		}
-	}
-
-	public String toString() {
-		return "Exceptions: " + exceptions;
-	}
-
-	protected void writeBody(DataOutputStream dos) throws IOException {
-		dos.writeShort(exceptionIndexes.length);
-		for (int i = 0; i < exceptionIndexes.length; i++) {
-			dos.writeShort(exceptionIndexes[i]);
-		}
-	}
+    private static int hashCode(Object[] array) {
+        final int prime = 31;
+        if (array == null)
+            return 0;
+        int result = 1;
+        for (int index = 0; index < array.length; index++) {
+            result = prime * result
+                    + (array[index] == null ? 0 : array[index].hashCode());
+        }
+        return result;
+    }
+
+    private transient int[] exceptionIndexes;
+
+    private final CPClass[] exceptions;
+
+    public ExceptionsAttribute(CPClass[] exceptions) {
+        super(attributeName);
+        this.exceptions = exceptions;
+    }
+
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (!super.equals(obj))
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        final ExceptionsAttribute other = (ExceptionsAttribute) obj;
+        if (!Arrays.equals(exceptions, other.exceptions))
+            return false;
+        return true;
+    }
+
+    protected int getLength() {
+        return 2 + 2 * exceptions.length;
+    }
+
+    protected ClassFileEntry[] getNestedClassFileEntries() {
+        ClassFileEntry[] result = new ClassFileEntry[exceptions.length + 1];
+        for (int i = 0; i < exceptions.length; i++) {
+            result[i] = exceptions[i];
+        }
+        result[exceptions.length] = getAttributeName();
+        return result;
+    }
+
+    public int hashCode() {
+        final int prime = 31;
+        int result = super.hashCode();
+        result = prime * result + ExceptionsAttribute.hashCode(exceptions);
+        return result;
+    }
+
+    protected void resolve(ClassConstantPool pool) {
+        super.resolve(pool);
+        exceptionIndexes = new int[exceptions.length];
+        for (int i = 0; i < exceptions.length; i++) {
+            exceptions[i].resolve(pool);
+            exceptionIndexes[i] = pool.indexOf(exceptions[i]);
+        }
+    }
+
+    public String toString() {
+        return "Exceptions: " + exceptions;
+    }
+
+    protected void writeBody(DataOutputStream dos) throws IOException {
+        dos.writeShort(exceptionIndexes.length);
+        for (int i = 0; i < exceptionIndexes.length; i++) {
+            dos.writeShort(exceptionIndexes[i]);
+        }
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/InnerClassesAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/InnerClassesAttribute.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/InnerClassesAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/InnerClassesAttribute.java Fri Apr 11 03:09:38 2008
@@ -31,6 +31,7 @@
             "InnerClasses", ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ); //$NON-NLS-1$
 
     private static class InnerClassesEntry {
+
         CPClass inner_class_info;
         CPClass outer_class_info;
         CPUTF8 inner_class_name;
@@ -40,7 +41,8 @@
         int inner_name_index = -1;
         int inner_class_access_flags = -1;
 
-        public InnerClassesEntry(CPClass innerClass, CPClass outerClass, CPUTF8 innerName, int flags) {
+        public InnerClassesEntry(CPClass innerClass, CPClass outerClass,
+                CPUTF8 innerName, int flags) {
             this.inner_class_info = innerClass;
             this.outer_class_info = outerClass;
             this.inner_class_name = innerName;
@@ -48,27 +50,29 @@
         }
 
         /**
-         * Determine the indices of the things in the receiver
-         * which point to elements of the ClassConstantPool
-         * @param pool ClassConstantPool which holds the
-         *      CPClass and CPUTF8 objects.
+         * Determine the indices of the things in the receiver which point to
+         * elements of the ClassConstantPool
+         * 
+         * @param pool
+         *            ClassConstantPool which holds the CPClass and CPUTF8
+         *            objects.
          */
         public void resolve(ClassConstantPool pool) {
-            if(inner_class_info != null) {
+            if (inner_class_info != null) {
                 inner_class_info.resolve(pool);
                 inner_class_info_index = pool.indexOf(inner_class_info);
             } else {
                 inner_class_info_index = 0;
             }
 
-            if(inner_class_name != null) {
+            if (inner_class_name != null) {
                 inner_class_name.resolve(pool);
                 inner_name_index = pool.indexOf(inner_class_name);
             } else {
                 inner_name_index = 0;
             }
 
-            if(outer_class_info != null) {
+            if (outer_class_info != null) {
                 outer_class_info.resolve(pool);
                 outer_class_info_index = pool.indexOf(outer_class_info);
             } else {
@@ -114,9 +118,10 @@
     }
 
     protected ClassFileEntry[] getNestedClassFileEntries() {
-        ClassFileEntry[] result = new ClassFileEntry[nestedClassFileEntries.size()];
-        for(int index=0; index < result.length; index++) {
-            result[index] = (ClassFileEntry)nestedClassFileEntries.get(index);
+        ClassFileEntry[] result = new ClassFileEntry[nestedClassFileEntries
+                .size()];
+        for (int index = 0; index < result.length; index++) {
+            result[index] = (ClassFileEntry) nestedClassFileEntries.get(index);
         }
         return result;
     }
@@ -124,15 +129,18 @@
     public int hashCode() {
         final int PRIME = 31;
         int result = super.hashCode();
-        result = PRIME * result + ((getAttributeName() == null) ? 0 : getAttributeName().hashCode());
+        result = PRIME
+                * result
+                + ((getAttributeName() == null) ? 0 : getAttributeName()
+                        .hashCode());
         return result;
     }
 
     protected void resolve(ClassConstantPool pool) {
         super.resolve(pool);
         Iterator it = innerClasses.iterator();
-        while(it.hasNext()) {
-            InnerClassesEntry entry = (InnerClassesEntry)it.next();
+        while (it.hasNext()) {
+            InnerClassesEntry entry = (InnerClassesEntry) it.next();
             entry.resolve(pool);
         }
     }
@@ -149,23 +157,25 @@
     protected void writeBody(DataOutputStream dos) throws IOException {
         dos.writeShort(innerClasses.size());
         Iterator it = innerClasses.iterator();
-        while(it.hasNext()) {
-            InnerClassesEntry entry = (InnerClassesEntry)it.next();
+        while (it.hasNext()) {
+            InnerClassesEntry entry = (InnerClassesEntry) it.next();
             entry.write(dos);
         }
     }
 
-    public void addInnerClassesEntry(CPClass innerClass, CPClass outerClass, CPUTF8 innerName, int flags) {
-        if(innerClass != null) {
+    public void addInnerClassesEntry(CPClass innerClass, CPClass outerClass,
+            CPUTF8 innerName, int flags) {
+        if (innerClass != null) {
             nestedClassFileEntries.add(innerClass);
         }
-        if(outerClass != null) {
+        if (outerClass != null) {
             nestedClassFileEntries.add(outerClass);
         }
-        if(innerName != null) {
+        if (innerName != null) {
             nestedClassFileEntries.add(innerName);
         }
-        addInnerClassesEntry(new InnerClassesEntry(innerClass, outerClass, innerName, flags));
+        addInnerClassesEntry(new InnerClassesEntry(innerClass, outerClass,
+                innerName, flags));
     }
 
     private void addInnerClassesEntry(InnerClassesEntry innerClassesEntry) {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/LineNumberTableAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/LineNumberTableAttribute.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/LineNumberTableAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/LineNumberTableAttribute.java Fri Apr 11 03:09:38 2008
@@ -30,8 +30,8 @@
     private static final CPUTF8 attributeName = new CPUTF8(
             "LineNumberTable", ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ); //$NON-NLS-1$
 
-
-    public LineNumberTableAttribute(int line_number_table_length, int[] start_pcs, int[] line_numbers) {
+    public LineNumberTableAttribute(int line_number_table_length,
+            int[] start_pcs, int[] line_numbers) {
         super(attributeName);
         this.line_number_table_length = line_number_table_length;
         this.start_pcs = start_pcs;
@@ -50,26 +50,32 @@
         }
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.harmony.pack200.bytecode.ClassFileEntry#toString()
      */
     public String toString() {
         return "LineNumberTable: " + line_number_table_length + " lines";
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.harmony.pack200.bytecode.Attribute#getNestedClassFileEntries()
      */
     protected ClassFileEntry[] getNestedClassFileEntries() {
-        return new ClassFileEntry[] {getAttributeName()};
+        return new ClassFileEntry[] { getAttributeName() };
     }
 
-	/* (non-Javadoc)
-	 * @see org.apache.harmony.pack200.bytecode.Attribute#resolve(org.apache.harmony.pack200.bytecode.ClassConstantPool)
-	 */
-	protected void resolve(ClassConstantPool pool) {
-		super.resolve(pool);
-	}
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.harmony.pack200.bytecode.Attribute#resolve(org.apache.harmony.pack200.bytecode.ClassConstantPool)
+     */
+    protected void resolve(ClassConstantPool pool) {
+        super.resolve(pool);
+    }
 
     protected int[] getStartPCs() {
         return start_pcs;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTableAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTableAttribute.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTableAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTableAttribute.java Fri Apr 11 03:09:38 2008
@@ -92,39 +92,45 @@
     }
 
     public String toString() {
-        return "LocalVariableTable: " + + local_variable_table_length + " variables";
+        return "LocalVariableTable: " + +local_variable_table_length
+                + " variables";
     }
 
     protected int[] getStartPCs() {
         return start_pcs;
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.harmony.pack200.bytecode.BCIRenumberedAttribute#renumber(java.util.List)
      */
     public void renumber(List byteCodeOffsets) throws Pack200Exception {
         // Remember the unrenumbered start_pcs, since that's used later
         // to calculate end position.
         int[] unrenumbered_start_pcs = new int[start_pcs.length];
-        System.arraycopy(start_pcs, 0, unrenumbered_start_pcs, 0, start_pcs.length);
+        System.arraycopy(start_pcs, 0, unrenumbered_start_pcs, 0,
+                start_pcs.length);
 
         // Next renumber start_pcs in place
         super.renumber(byteCodeOffsets);
 
         // lengths are BRANCH5 encoded, not BCI-encoded.
         // In other words:
-        //  start_pc is BCI5 start_pc
-        //  end_pc is byteCodeOffset[(index of start_pc in byteCodeOffset) + (encoded length)]
-        //  real length = end_pc - start_pc
+        // start_pc is BCI5 start_pc
+        // end_pc is byteCodeOffset[(index of start_pc in byteCodeOffset) +
+        // (encoded length)]
+        // real length = end_pc - start_pc
         // special case if end_pc is beyond end of bytecode array
 
         // First figure out the maximum size of the byteCodeOffsets array
-        int lastInstruction = ((Integer)byteCodeOffsets.get(byteCodeOffsets.size() - 1)).intValue();
+        int lastInstruction = ((Integer) byteCodeOffsets.get(byteCodeOffsets
+                .size() - 1)).intValue();
         int maxSize = lastInstruction + 1;
 
         // Iterate through the lengths and update each in turn.
         // This is done in place in the lengths array.
-        for(int index=0; index < lengths.length; index++) {
+        for (int index = 0; index < lengths.length; index++) {
             int start_pc = start_pcs[index];
             int revisedLength = -1;
             int encodedLength = lengths[index];
@@ -134,17 +140,19 @@
             // Given the index of the start_pc, we can now add
             // the encodedLength to it to get the stop index.
             int stopIndex = indexOfStartPC + encodedLength;
-            if(stopIndex < 0) {
+            if (stopIndex < 0) {
                 throw new Pack200Exception("Error renumbering bytecode indexes");
             }
-            // Length can either be an index into the byte code offsets, or one beyond the
+            // Length can either be an index into the byte code offsets, or one
+            // beyond the
             // end of the byte code offsets. Need to determine which this is.
-            if(stopIndex == byteCodeOffsets.size()) {
+            if (stopIndex == byteCodeOffsets.size()) {
                 // Pointing to one past the end of the byte code array
                 revisedLength = maxSize - start_pc;
             } else {
                 // We're indexed into the byte code array
-                int stopValue = ((Integer)byteCodeOffsets.get(stopIndex)).intValue();
+                int stopValue = ((Integer) byteCodeOffsets.get(stopIndex))
+                        .intValue();
                 revisedLength = stopValue - start_pc;
             }
             lengths[index] = revisedLength;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTypeTableAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTypeTableAttribute.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTypeTableAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/LocalVariableTypeTableAttribute.java Fri Apr 11 03:09:38 2008
@@ -35,9 +35,9 @@
     private static final CPUTF8 attributeName = new CPUTF8(
             "LocalVariableTypeTable", ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ); //$NON-NLS-1$
 
-    public LocalVariableTypeTableAttribute(int local_variable_type_table_length,
-            int[] start_pcs, int[] lengths, CPUTF8[] names,
-            CPUTF8[] signatures, int[] indexes) {
+    public LocalVariableTypeTableAttribute(
+            int local_variable_type_table_length, int[] start_pcs,
+            int[] lengths, CPUTF8[] names, CPUTF8[] signatures, int[] indexes) {
         super(attributeName);
         this.local_variable_type_table_length = local_variable_type_table_length;
         this.start_pcs = start_pcs;
@@ -75,7 +75,8 @@
     }
 
     public String toString() {
-        return "LocalVariableTypeTable: " + + local_variable_type_table_length + " varaibles";
+        return "LocalVariableTypeTable: " + +local_variable_type_table_length
+                + " varaibles";
     }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/NewAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/NewAttribute.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/NewAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/NewAttribute.java Fri Apr 11 03:09:38 2008
@@ -35,7 +35,9 @@
         super(attributeName);
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.harmony.pack200.bytecode.Attribute#getLength()
      */
     protected int getLength() {
@@ -46,7 +48,9 @@
         return length;
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.harmony.pack200.bytecode.Attribute#writeBody(java.io.DataOutputStream)
      */
     protected void writeBody(DataOutputStream dos) throws IOException {
@@ -54,27 +58,29 @@
             int length = ((Integer) lengths.get(i)).intValue();
             Object obj = body.get(i);
             long value = 0;
-            if(obj instanceof Long) {
-                value = ((Long)obj).longValue();
+            if (obj instanceof Long) {
+                value = ((Long) obj).longValue();
             } else if (obj instanceof ClassFileEntry) {
-                value = pool.indexOf(((ClassFileEntry)obj));
+                value = pool.indexOf(((ClassFileEntry) obj));
             } else if (obj instanceof BCValue) {
-                value = ((BCValue)obj).actualValue;
+                value = ((BCValue) obj).actualValue;
             }
             // Write
-            if(length == 1) {
-                dos.writeByte((int)value);
+            if (length == 1) {
+                dos.writeByte((int) value);
             } else if (length == 2) {
-                dos.writeShort((int)value);
+                dos.writeShort((int) value);
             } else if (length == 4) {
-                dos.writeInt((int)value);
+                dos.writeInt((int) value);
             } else if (length == 8) {
                 dos.writeLong(value);
             }
         }
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.harmony.pack200.bytecode.ClassFileEntry#toString()
      */
     public String toString() {
@@ -140,8 +146,8 @@
         super.resolve(pool);
         for (Iterator iter = body.iterator(); iter.hasNext();) {
             Object element = iter.next();
-            if(element instanceof ClassFileEntry) {
-                ((ClassFileEntry)element).resolve(pool);
+            if (element instanceof ClassFileEntry) {
+                ((ClassFileEntry) element).resolve(pool);
             }
         }
         this.pool = pool;
@@ -197,33 +203,41 @@
     }
 
     public void renumber(List byteCodeOffsets) {
-        if(!renumbered) {
+        if (!renumbered) {
             Object previous = null;
             for (Iterator iter = body.iterator(); iter.hasNext();) {
                 Object obj = iter.next();
-                if(obj instanceof BCIndex) {
+                if (obj instanceof BCIndex) {
                     BCIndex bcIndex = (BCIndex) obj;
-                    bcIndex.setActualValue(((Integer)byteCodeOffsets.get(bcIndex.index)).intValue());
+                    bcIndex.setActualValue(((Integer) byteCodeOffsets
+                            .get(bcIndex.index)).intValue());
                 } else if (obj instanceof BCOffset) {
-                    BCOffset bcOffset = (BCOffset)obj;
-                    if(previous instanceof BCIndex) {
-                        int index = ((BCIndex)previous).index + bcOffset.offset;
+                    BCOffset bcOffset = (BCOffset) obj;
+                    if (previous instanceof BCIndex) {
+                        int index = ((BCIndex) previous).index
+                                + bcOffset.offset;
                         bcOffset.setIndex(index);
-                        bcOffset.setActualValue(((Integer)byteCodeOffsets.get(index)).intValue());
-                    } else if(previous instanceof BCOffset) {
-                        int index = ((BCOffset)previous).index + bcOffset.offset;
+                        bcOffset.setActualValue(((Integer) byteCodeOffsets
+                                .get(index)).intValue());
+                    } else if (previous instanceof BCOffset) {
+                        int index = ((BCOffset) previous).index
+                                + bcOffset.offset;
                         bcOffset.setIndex(index);
-                        bcOffset.setActualValue(((Integer)byteCodeOffsets.get(index)).intValue());
+                        bcOffset.setActualValue(((Integer) byteCodeOffsets
+                                .get(index)).intValue());
                     } else {
                         // Not sure if this should be able to happen
-                        bcOffset.setActualValue(((Integer)byteCodeOffsets.get(bcOffset.offset)).intValue());
+                        bcOffset.setActualValue(((Integer) byteCodeOffsets
+                                .get(bcOffset.offset)).intValue());
                     }
                 } else if (obj instanceof BCLength) {
                     // previous must be a BCIndex
                     BCLength bcLength = (BCLength) obj;
                     BCIndex prevIndex = (BCIndex) previous;
                     int index = prevIndex.index + bcLength.length;
-                    int actualLength = ((Integer)byteCodeOffsets.get(index)).intValue() - prevIndex.actualValue;
+                    int actualLength = ((Integer) byteCodeOffsets.get(index))
+                            .intValue()
+                            - prevIndex.actualValue;
                     bcLength.setActualValue(actualLength);
                 }
                 previous = obj;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/OperandManager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/OperandManager.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/OperandManager.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/OperandManager.java Fri Apr 11 03:09:38 2008
@@ -42,65 +42,71 @@
     int[] bcFieldRef;
     int[] bcMethodRef;
     int[] bcIMethodRef;
-	int[] bcThisField;
-	int[] bcSuperField;
-	int[] bcThisMethod;
-	int[] bcSuperMethod;
-	int[] bcInitRef;
-	int[] wideByteCodes;
-
-	int bcCaseCountIndex = 0;
-	int bcCaseValueIndex = 0;
-	int bcByteIndex = 0;
-	int bcShortIndex = 0;
-	int bcLocalIndex = 0;
-	int bcLabelIndex = 0;
-	int bcIntRefIndex = 0;
-	int bcFloatRefIndex = 0;
-	int bcLongRefIndex = 0;
-	int bcDoubleRefIndex = 0;
-	int bcStringRefIndex = 0;
-	int bcClassRefIndex = 0;
-	int bcFieldRefIndex = 0;
-	int bcMethodRefIndex = 0;
-	int bcIMethodRefIndex = 0;
-	int bcThisFieldIndex = 0;
-	int bcSuperFieldIndex = 0;
-	int bcThisMethodIndex = 0;
-	int bcSuperMethodIndex = 0;
-	int bcInitRefIndex = 0;
-	int wideByteCodeIndex = 0;
-
-	Segment segment = null;
-
-	String currentClass = null;
-	String superClass = null;
-	String newClass = null;
-
-	public OperandManager(int[] bcCaseCount, int[] bcCaseValue, int[] bcByte, int[]  bcShort, int[]  bcLocal, int[]  bcLabel, int[]  bcIntRef, int[]  bcFloatRef, int[]  bcLongRef, int[]  bcDoubleRef, int[]  bcStringRef, int[]  bcClassRef, int[]  bcFieldRef, int[]  bcMethodRef, int[] bcIMethodRef, int[] bcThisField, int[] bcSuperField, int[] bcThisMethod, int[] bcSuperMethod, int[] bcInitRef, int[] wideByteCodes) {
-	    this.bcCaseCount = bcCaseCount;
-	    this.bcCaseValue = bcCaseValue;
-	    this.bcByte = bcByte;
-	    this.bcShort = bcShort;
-	    this.bcLocal = bcLocal;
-	    this.bcLabel = bcLabel;
-	    this.bcIntRef = bcIntRef;
-	    this.bcFloatRef = bcFloatRef;
-	    this.bcLongRef = bcLongRef;
-	    this.bcDoubleRef = bcDoubleRef;
-	    this.bcStringRef = bcStringRef;
-	    this.bcClassRef = bcClassRef;
-	    this.bcFieldRef = bcFieldRef;
-	    this.bcMethodRef = bcMethodRef;
-	    this.bcIMethodRef = bcIMethodRef;
-
-	    this.bcThisField = bcThisField;
-	    this.bcSuperField = bcSuperField;
-	    this.bcThisMethod = bcThisMethod;
-	    this.bcSuperMethod = bcSuperMethod;
-	    this.bcInitRef = bcInitRef;
-	    this.wideByteCodes = wideByteCodes;
-	}
+    int[] bcThisField;
+    int[] bcSuperField;
+    int[] bcThisMethod;
+    int[] bcSuperMethod;
+    int[] bcInitRef;
+    int[] wideByteCodes;
+
+    int bcCaseCountIndex = 0;
+    int bcCaseValueIndex = 0;
+    int bcByteIndex = 0;
+    int bcShortIndex = 0;
+    int bcLocalIndex = 0;
+    int bcLabelIndex = 0;
+    int bcIntRefIndex = 0;
+    int bcFloatRefIndex = 0;
+    int bcLongRefIndex = 0;
+    int bcDoubleRefIndex = 0;
+    int bcStringRefIndex = 0;
+    int bcClassRefIndex = 0;
+    int bcFieldRefIndex = 0;
+    int bcMethodRefIndex = 0;
+    int bcIMethodRefIndex = 0;
+    int bcThisFieldIndex = 0;
+    int bcSuperFieldIndex = 0;
+    int bcThisMethodIndex = 0;
+    int bcSuperMethodIndex = 0;
+    int bcInitRefIndex = 0;
+    int wideByteCodeIndex = 0;
+
+    Segment segment = null;
+
+    String currentClass = null;
+    String superClass = null;
+    String newClass = null;
+
+    public OperandManager(int[] bcCaseCount, int[] bcCaseValue, int[] bcByte,
+            int[] bcShort, int[] bcLocal, int[] bcLabel, int[] bcIntRef,
+            int[] bcFloatRef, int[] bcLongRef, int[] bcDoubleRef,
+            int[] bcStringRef, int[] bcClassRef, int[] bcFieldRef,
+            int[] bcMethodRef, int[] bcIMethodRef, int[] bcThisField,
+            int[] bcSuperField, int[] bcThisMethod, int[] bcSuperMethod,
+            int[] bcInitRef, int[] wideByteCodes) {
+        this.bcCaseCount = bcCaseCount;
+        this.bcCaseValue = bcCaseValue;
+        this.bcByte = bcByte;
+        this.bcShort = bcShort;
+        this.bcLocal = bcLocal;
+        this.bcLabel = bcLabel;
+        this.bcIntRef = bcIntRef;
+        this.bcFloatRef = bcFloatRef;
+        this.bcLongRef = bcLongRef;
+        this.bcDoubleRef = bcDoubleRef;
+        this.bcStringRef = bcStringRef;
+        this.bcClassRef = bcClassRef;
+        this.bcFieldRef = bcFieldRef;
+        this.bcMethodRef = bcMethodRef;
+        this.bcIMethodRef = bcIMethodRef;
+
+        this.bcThisField = bcThisField;
+        this.bcSuperField = bcSuperField;
+        this.bcThisMethod = bcThisMethod;
+        this.bcSuperMethod = bcSuperMethod;
+        this.bcInitRef = bcInitRef;
+        this.wideByteCodes = wideByteCodes;
+    }
 
     public int nextCaseCount() {
         return bcCaseCount[bcCaseCountIndex++];
@@ -110,122 +116,127 @@
         return bcCaseValue[bcCaseValueIndex++];
     }
 
-	public int nextByte() {
-		return bcByte[bcByteIndex++];
-	}
-
-	public int nextShort() {
-		return bcShort[bcShortIndex++];
-	}
-
-	public int nextLocal() {
-		return bcLocal[bcLocalIndex++];
-	}
-
-	public int nextLabel() {
-		return bcLabel[bcLabelIndex++];
-	}
-
-	public int nextIntRef() {
-		return bcIntRef[bcIntRefIndex++];
-	}
-
-	public int nextFloatRef() {
-		return bcFloatRef[bcFloatRefIndex++];
-	}
-
-	public int nextLongRef() {
-		return bcLongRef[bcLongRefIndex++];
-	}
-
-	public int nextDoubleRef() {
-		return bcDoubleRef[bcDoubleRefIndex++];
-	}
-
-	public int nextStringRef() {
-		return bcStringRef[bcStringRefIndex++];
-	}
-
-	public int nextClassRef() {
-		return bcClassRef[bcClassRefIndex++];
-	}
-
-	public int nextFieldRef() {
-		return bcFieldRef[bcFieldRefIndex++];
-	}
-
-	public int nextMethodRef() {
-		return bcMethodRef[bcMethodRefIndex++];
-	}
-
-	public int nextIMethodRef() {
-		return bcIMethodRef[bcIMethodRefIndex++];
-	}
-
-	public int nextThisFieldRef() {
-		return bcThisField[bcThisFieldIndex++];
-	}
-
-	public int nextSuperFieldRef() {
-		return bcSuperField[bcSuperFieldIndex++];
-	}
-
-	public int nextThisMethodRef() {
-		return bcThisMethod[bcThisMethodIndex++];
-	}
-
-	public int nextSuperMethodRef() {
-		return bcSuperMethod[bcSuperMethodIndex++];
-	}
-
-	public int nextInitRef() {
-		return bcInitRef[bcInitRefIndex++];
-	}
-
-	public int nextWideByteCode() {
-	    return wideByteCodes[wideByteCodeIndex++];
-	}
-
-	public void setSegment(Segment segment) {
-		this.segment = segment;
-	}
-	public Segment getSegment() {
-		return segment;
-	}
-
-	public SegmentConstantPool globalConstantPool() {
-		return segment.getConstantPool();
-	}
-
-	public void setCurrentClass(String string) {
-		currentClass = string;
-	}
-	public void setSuperClass(String string) {
-		superClass = string;
-	}
-	public void setNewClass(String string) {
-		newClass = string;
-	}
-
-	public String getCurrentClass() {
-		if(null==currentClass) {
-			throw new Error("Current class not set yet");
-		} else {
-			return currentClass;
-		}
-	}
-	public String getSuperClass() {
-		if(null==superClass) {
-			throw new Error("SuperClass not set yet");
-		} else {
-			return superClass;
-		}
-	}
-	public String getNewClass() {
-		if(null==newClass) {
-			throw new Error("New class not set yet");
-		} else {
-			return newClass;
-		}
-	}
+    public int nextByte() {
+        return bcByte[bcByteIndex++];
+    }
+
+    public int nextShort() {
+        return bcShort[bcShortIndex++];
+    }
+
+    public int nextLocal() {
+        return bcLocal[bcLocalIndex++];
+    }
+
+    public int nextLabel() {
+        return bcLabel[bcLabelIndex++];
+    }
+
+    public int nextIntRef() {
+        return bcIntRef[bcIntRefIndex++];
+    }
+
+    public int nextFloatRef() {
+        return bcFloatRef[bcFloatRefIndex++];
+    }
+
+    public int nextLongRef() {
+        return bcLongRef[bcLongRefIndex++];
+    }
+
+    public int nextDoubleRef() {
+        return bcDoubleRef[bcDoubleRefIndex++];
+    }
+
+    public int nextStringRef() {
+        return bcStringRef[bcStringRefIndex++];
+    }
+
+    public int nextClassRef() {
+        return bcClassRef[bcClassRefIndex++];
+    }
+
+    public int nextFieldRef() {
+        return bcFieldRef[bcFieldRefIndex++];
+    }
+
+    public int nextMethodRef() {
+        return bcMethodRef[bcMethodRefIndex++];
+    }
+
+    public int nextIMethodRef() {
+        return bcIMethodRef[bcIMethodRefIndex++];
+    }
+
+    public int nextThisFieldRef() {
+        return bcThisField[bcThisFieldIndex++];
+    }
+
+    public int nextSuperFieldRef() {
+        return bcSuperField[bcSuperFieldIndex++];
+    }
+
+    public int nextThisMethodRef() {
+        return bcThisMethod[bcThisMethodIndex++];
+    }
+
+    public int nextSuperMethodRef() {
+        return bcSuperMethod[bcSuperMethodIndex++];
+    }
+
+    public int nextInitRef() {
+        return bcInitRef[bcInitRefIndex++];
+    }
+
+    public int nextWideByteCode() {
+        return wideByteCodes[wideByteCodeIndex++];
+    }
+
+    public void setSegment(Segment segment) {
+        this.segment = segment;
+    }
+
+    public Segment getSegment() {
+        return segment;
+    }
+
+    public SegmentConstantPool globalConstantPool() {
+        return segment.getConstantPool();
+    }
+
+    public void setCurrentClass(String string) {
+        currentClass = string;
+    }
+
+    public void setSuperClass(String string) {
+        superClass = string;
+    }
+
+    public void setNewClass(String string) {
+        newClass = string;
+    }
+
+    public String getCurrentClass() {
+        if (null == currentClass) {
+            throw new Error("Current class not set yet");
+        } else {
+            return currentClass;
+        }
+    }
+
+    public String getSuperClass() {
+        if (null == superClass) {
+            throw new Error("SuperClass not set yet");
+        } else {
+            return superClass;
+        }
+    }
+
+    public String getNewClass() {
+        if (null == newClass) {
+            throw new Error("New class not set yet");
+        } else {
+            return newClass;
+        }
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/RuntimeVisibleorInvisibleAnnotationsAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/RuntimeVisibleorInvisibleAnnotationsAttribute.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/RuntimeVisibleorInvisibleAnnotationsAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/RuntimeVisibleorInvisibleAnnotationsAttribute.java Fri Apr 11 03:09:38 2008
@@ -23,23 +23,25 @@
  * Annotations class file attribute, either a RuntimeVisibleAnnotations
  * attribute or a RuntimeInvisibleAnnotations attribute.
  */
-public class RuntimeVisibleorInvisibleAnnotationsAttribute extends AnnotationsAttribute {
+public class RuntimeVisibleorInvisibleAnnotationsAttribute extends
+        AnnotationsAttribute {
 
     private final int num_annotations;
     private final Annotation[] annotations;
 
-    public RuntimeVisibleorInvisibleAnnotationsAttribute(CPUTF8 name, Annotation[] annotations) {
+    public RuntimeVisibleorInvisibleAnnotationsAttribute(CPUTF8 name,
+            Annotation[] annotations) {
         super(name);
         this.num_annotations = annotations.length;
         this.annotations = annotations;
     }
 
     protected int getLength() {
-       int length = 2;
-       for (int i = 0; i < num_annotations; i++) {
-           length += annotations[i].getLength();
-       }
-       return length;
+        int length = 2;
+        for (int i = 0; i < num_annotations; i++) {
+            length += annotations[i].getLength();
+        }
+        return length;
     }
 
     protected void resolve(ClassConstantPool pool) {
@@ -57,7 +59,8 @@
     }
 
     public String toString() {
-        return attributeName.underlyingString() + ": " + num_annotations + " annotations";
+        return attributeName.underlyingString() + ": " + num_annotations
+                + " annotations";
     }
 
 }



Mime
View raw message