harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjanu...@apache.org
Subject svn commit: r650483 [2/2] - in /harmony/enhanced/classlib/trunk/modules/pack200/src: main/java/org/apache/harmony/unpack200/ main/java/org/apache/harmony/unpack200/bytecode/ test/java/org/apache/harmony/unpack200/tests/ test/java/org/apache/harmony/unp...
Date Tue, 22 Apr 2008 12:40:24 GMT
Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPClass.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPClass.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPClass.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPClass.java Tue Apr 22 05:39:29 2008
@@ -37,8 +37,8 @@
      * @throws NullPointerException
      *             if name is null
      */
-    public CPClass(CPUTF8 name) {
-        super(ConstantPoolEntry.CP_Class);
+    public CPClass(CPUTF8 name, int globalIndex) {
+        super(ConstantPoolEntry.CP_Class, globalIndex);
         this.name = name.underlyingString();
         this.domain = ClassConstantPool.DOMAIN_CLASSREF;
         this.utf8 = name;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPConstant.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPConstant.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPConstant.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPConstant.java Tue Apr 22 05:39:29 2008
@@ -32,8 +32,8 @@
      * @throws NullPointerException
      *             if value is null
      */
-    public CPConstant(byte tag, Object value) {
-        super(tag);
+    public CPConstant(byte tag, Object value, int globalIndex) {
+        super(tag, globalIndex);
         this.value = value;
         if (value == null) {
             throw new NullPointerException("Null arguments are not allowed");

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPConstantNumber.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPConstantNumber.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPConstantNumber.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPConstantNumber.java Tue Apr 22 05:39:29 2008
@@ -21,8 +21,8 @@
  */
 public abstract class CPConstantNumber extends CPConstant {
 
-    public CPConstantNumber(byte tag, Object value) {
-        super(tag, value);
+    public CPConstantNumber(byte tag, Object value, int globalIndex) {
+        super(tag, value, globalIndex);
     }
 
     protected Number getNumber() {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPDouble.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPDouble.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPDouble.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPDouble.java Tue Apr 22 05:39:29 2008
@@ -24,8 +24,8 @@
  */
 public class CPDouble extends CPConstantNumber {
 
-    public CPDouble(Double value) {
-        super(ConstantPoolEntry.CP_Double, value);
+    public CPDouble(Double value, int globalIndex) {
+        super(ConstantPoolEntry.CP_Double, value, globalIndex);
         this.domain = ClassConstantPool.DOMAIN_DOUBLE;
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPField.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPField.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPField.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPField.java Tue Apr 22 05:39:29 2008
@@ -27,4 +27,8 @@
         super(name, descriptor, flags, attributes);
     }
 
+    public String toString() {
+        return "Field: " + name + "(" + descriptor + ")";
+    }
+
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPFieldRef.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPFieldRef.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPFieldRef.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPFieldRef.java Tue Apr 22 05:39:29 2008
@@ -29,8 +29,8 @@
     private final CPNameAndType nameAndType;
     transient int nameAndTypeIndex;
 
-    public CPFieldRef(CPClass className, CPNameAndType descriptor) {
-        super(ConstantPoolEntry.CP_Fieldref);
+    public CPFieldRef(CPClass className, CPNameAndType descriptor, int globalIndex) {
+        super(ConstantPoolEntry.CP_Fieldref, globalIndex);
         this.domain = ClassConstantPool.DOMAIN_FIELD;
         this.className = className;
         this.nameAndType = descriptor;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPFloat.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPFloat.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPFloat.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPFloat.java Tue Apr 22 05:39:29 2008
@@ -24,8 +24,8 @@
  */
 public class CPFloat extends CPConstantNumber {
 
-    public CPFloat(Float value) {
-        super(ConstantPoolEntry.CP_Float, value);
+    public CPFloat(Float value, int globalIndex) {
+        super(ConstantPoolEntry.CP_Float, value, globalIndex);
         this.domain = ClassConstantPool.DOMAIN_FLOAT;
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPInteger.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPInteger.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPInteger.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPInteger.java Tue Apr 22 05:39:29 2008
@@ -24,8 +24,8 @@
  */
 public class CPInteger extends CPConstantNumber {
 
-    public CPInteger(Integer value) {
-        super(ConstantPoolEntry.CP_Integer, value);
+    public CPInteger(Integer value, int globalIndex) {
+        super(ConstantPoolEntry.CP_Integer, value, globalIndex);
         this.domain = ClassConstantPool.DOMAIN_INTEGER;
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPInterfaceMethodRef.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPInterfaceMethodRef.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPInterfaceMethodRef.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPInterfaceMethodRef.java Tue Apr 22 05:39:29 2008
@@ -18,8 +18,8 @@
  */
 public class CPInterfaceMethodRef extends CPRef {
 
-    public CPInterfaceMethodRef(CPClass className, CPNameAndType descriptor) {
-        super(ConstantPoolEntry.CP_InterfaceMethodref, className, descriptor);
+    public CPInterfaceMethodRef(CPClass className, CPNameAndType descriptor, int globalIndex) {
+        super(ConstantPoolEntry.CP_InterfaceMethodref, className, descriptor, globalIndex);
         this.domain = ClassConstantPool.DOMAIN_METHOD;
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPLong.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPLong.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPLong.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPLong.java Tue Apr 22 05:39:29 2008
@@ -24,8 +24,8 @@
  */
 public class CPLong extends CPConstantNumber {
 
-    public CPLong(Long value) {
-        super(ConstantPoolEntry.CP_Long, value);
+    public CPLong(Long value, int globalIndex) {
+        super(ConstantPoolEntry.CP_Long, value, globalIndex);
         this.domain = ClassConstantPool.DOMAIN_LONG;
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPMember.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPMember.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPMember.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPMember.java Tue Apr 22 05:39:29 2008
@@ -31,7 +31,7 @@
     short flags;
     CPUTF8 name;
     transient int nameIndex;
-    private final CPUTF8 descriptor;
+    protected final CPUTF8 descriptor;
     transient int descriptorIndex;
 
     /**
@@ -76,10 +76,6 @@
         }
     }
 
-    public String toString() {
-        return "Field: " + name + "(" + descriptor + ")";
-    }
-
     public int hashCode() {
         final int PRIME = 31;
         int result = 1;
@@ -88,6 +84,10 @@
         result = PRIME * result + flags;
         result = PRIME * result + name.hashCode();
         return result;
+    }
+
+    public String toString() {
+        return "CPMember: " + name + "(" + descriptor + ")";
     }
 
     public boolean equals(Object obj) {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPMethod.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPMethod.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPMethod.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPMethod.java Tue Apr 22 05:39:29 2008
@@ -27,4 +27,8 @@
         super(name, descriptor, flags, attributes);
     }
 
+    public String toString() {
+        return "Method: " + name + "(" + descriptor + ")";
+    }
+
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPMethodRef.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPMethodRef.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPMethodRef.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPMethodRef.java Tue Apr 22 05:39:29 2008
@@ -21,8 +21,8 @@
  */
 public class CPMethodRef extends CPRef {
 
-    public CPMethodRef(CPClass className, CPNameAndType descriptor) {
-        super(ConstantPoolEntry.CP_Methodref, className, descriptor);
+    public CPMethodRef(CPClass className, CPNameAndType descriptor, int globalIndex) {
+        super(ConstantPoolEntry.CP_Methodref, className, descriptor, globalIndex);
         this.domain = ClassConstantPool.DOMAIN_METHOD;
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPNameAndType.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPNameAndType.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPNameAndType.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPNameAndType.java Tue Apr 22 05:39:29 2008
@@ -43,8 +43,8 @@
      * @throws NullPointerException
      *             if name or descriptor is null
      */
-    public CPNameAndType(CPUTF8 name, CPUTF8 descriptor, int domain) {
-        super(ConstantPoolEntry.CP_NameAndType);
+    public CPNameAndType(CPUTF8 name, CPUTF8 descriptor, int domain, int globalIndex) {
+        super(ConstantPoolEntry.CP_NameAndType, globalIndex);
         this.name = name;
         this.descriptor = descriptor;
         this.domain = domain;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPRef.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPRef.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPRef.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPRef.java Tue Apr 22 05:39:29 2008
@@ -40,8 +40,8 @@
      * @throws NullPointerException
      *             if descriptor or className is null
      */
-    public CPRef(byte type, CPClass className, CPNameAndType descriptor) {
-        super(type);
+    public CPRef(byte type, CPClass className, CPNameAndType descriptor, int globalIndex) {
+        super(type, globalIndex);
         this.className = className;
         this.nameAndType = descriptor;
         if (descriptor == null || className == null) {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPString.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPString.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPString.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPString.java Tue Apr 22 05:39:29 2008
@@ -27,8 +27,8 @@
     private transient int nameIndex;
     private final CPUTF8 name;
 
-    public CPString(CPUTF8 value) {
-        super(ConstantPoolEntry.CP_String, value);
+    public CPString(CPUTF8 value, int globalIndex) {
+        super(ConstantPoolEntry.CP_String, value, globalIndex);
         this.domain = ClassConstantPool.DOMAIN_STRING;
         this.name = value;
     }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPUTF8.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPUTF8.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPUTF8.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPUTF8.java Tue Apr 22 05:39:29 2008
@@ -35,8 +35,8 @@
      * @throws NullPointerException
      *             if utf8 is null
      */
-    public CPUTF8(String utf8, int domain) {
-        super(ConstantPoolEntry.CP_UTF8);
+    public CPUTF8(String utf8, int domain, int globalIndex) {
+        super(ConstantPoolEntry.CP_UTF8, globalIndex);
         this.utf8 = utf8;
         this.domain = domain;
         if (domain == ClassConstantPool.DOMAIN_UNDEFINED) {
@@ -45,6 +45,10 @@
         if (utf8 == null) {
             throw new NullPointerException("Null arguments are not allowed");
         }
+    }
+
+    public CPUTF8(String string, int domain) {
+        this(string, domain, -1);
     }
 
     public boolean equals(Object obj) {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassConstantPool.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassConstantPool.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassConstantPool.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassConstantPool.java Tue Apr 22 05:39:29 2008
@@ -17,11 +17,14 @@
 package org.apache.harmony.unpack200.bytecode;
 
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.TreeSet;
 
 import org.apache.harmony.unpack200.Segment;
 
@@ -56,7 +59,7 @@
     }
 
     private final List others = new ArrayList(500);
-    private List entries = new ArrayList(500);
+    private final List entries = new ArrayList(500);
 
     private boolean resolved;
 
@@ -92,13 +95,32 @@
                 othersContainsSet.add(entry);
                 others.add(entry);
             }
+        }
+        return entry;
+    }
 
+    public void addNestedEntries() {
+        boolean added = true;
+        while (added) {
+            int entriesOriginalSize = entries.size();
+            int othersOriginalSize = others.size();
+            addNested(entries);
+            addNested(others);
+            added = !(entries.size() == entriesOriginalSize && others.size() == othersOriginalSize);
         }
-        ClassFileEntry[] nestedEntries = entry.getNestedClassFileEntries();
-        for (int i = 0; i < nestedEntries.length; i++) {
-            add(nestedEntries[i]);
+    }
+
+    private void addNested(List classFileEntries) {
+        List newEntries = new ArrayList();
+        for (Iterator iterator = classFileEntries.iterator(); iterator
+                .hasNext();) {
+            ClassFileEntry entry = (ClassFileEntry) iterator.next();
+            ClassFileEntry[] nestedEntries = entry.getNestedClassFileEntries();
+            newEntries.addAll(Arrays.asList(nestedEntries));
+        }
+        for (Iterator iterator = newEntries.iterator(); iterator.hasNext();) {
+            add((ClassFileEntry) iterator.next());
         }
-        return entry;
     }
 
     protected void initializeIndexCache() {
@@ -142,6 +164,7 @@
     }
 
     public void resolve(Segment segment) {
+        initialSort();
         Iterator it;
         resolved = true;
         it = entries.iterator();
@@ -158,6 +181,46 @@
         sortClassPool(segment);
     }
 
+    private void initialSort() {
+        TreeSet inCpAll = new TreeSet(new Comparator() {
+            public int compare(Object arg0, Object arg1) {
+                return ((ConstantPoolEntry)arg0).getGlobalIndex() - ((ConstantPoolEntry)arg1).getGlobalIndex();
+            }
+        });
+        TreeSet cpUtf8sNotInCpAll = new TreeSet(new Comparator() {
+
+            public int compare(Object arg0, Object arg1) {
+                return ((CPUTF8)arg0).underlyingString().compareTo(((CPUTF8)arg1).underlyingString());
+            }
+            
+        });
+        TreeSet cpClassesNotInCpAll = new TreeSet(new Comparator() {
+
+            public int compare(Object arg0, Object arg1) {
+                return ((CPClass)arg0).getName().compareTo(((CPClass)arg1).getName());
+            }
+            
+        });
+        for (Iterator iterator = entries.iterator(); iterator.hasNext();) {
+            ConstantPoolEntry entry = (ConstantPoolEntry) iterator.next();
+            if(entry.getGlobalIndex() == -1) {
+                if (entry instanceof CPUTF8) {
+                    cpUtf8sNotInCpAll.add(entry);
+                } else if (entry instanceof CPClass) {
+                    cpClassesNotInCpAll.add(entry);
+                } else {
+                    throw new Error("error");
+                }
+            } else {
+                inCpAll.add(entry);
+            }
+        }
+        entries.clear();
+        entries.addAll(inCpAll);
+        entries.addAll(cpUtf8sNotInCpAll);
+        entries.addAll(cpClassesNotInCpAll);
+    }
+
     /**
      * Answer the collection of CPClasses currently held by the ClassPoolSet.
      * This is used to calculate relevant classes when generating the set of
@@ -199,7 +262,7 @@
                 finalSort.add(nextEntry);
             }
         }
-        entries = new ArrayList(entries.size());
+        entries.clear();
         Iterator itStart = startOfPool.iterator();
         while (itStart.hasNext()) {
             ClassFileEntry entry = (ClassFileEntry) itStart.next();
@@ -215,7 +278,7 @@
                 entries.add(entry); // these get 2 slots because of their size
         }
 
-        // Since we resorted, need to initialize index cache
+        // Since we re-sorted, need to initialize index cache
         initializeIndexCache();
 
         // Now that the indices have been re-sorted, need
@@ -232,5 +295,14 @@
             ClassFileEntry entry = (ClassFileEntry) it.next();
             entry.resolve(this);
         }
+    }
+
+    public ClassFileEntry addWithNestedEntries(ClassFileEntry entry) {
+        add(entry);
+        ClassFileEntry[] nestedEntries = entry.getNestedClassFileEntries();
+        for (int i = 0; i < nestedEntries.length; i++) {
+            addWithNestedEntries(nestedEntries[i]);
+        }
+        return entry;
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassFile.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassFile.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassFile.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassFile.java Tue Apr 22 05:39:29 2008
@@ -50,7 +50,6 @@
                     || entry.getTag() == ConstantPoolEntry.CP_Long)
                 i++;
         }
-        ;
         dos.writeShort(accessFlags);
         dos.writeShort(thisClass);
         dos.writeShort(superClass);

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CodeAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CodeAttribute.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CodeAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CodeAttribute.java Tue Apr 22 05:39:29 2008
@@ -175,6 +175,10 @@
         return attributes;
     }
 
+    public boolean equals(Object obj) {
+        return this == obj;
+    }
+
     protected int[] getStartPCs() {
         // Do nothing here as we've overriden renumber
         return null;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ConstantPoolEntry.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ConstantPoolEntry.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ConstantPoolEntry.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ConstantPoolEntry.java Tue Apr 22 05:39:29 2008
@@ -57,8 +57,11 @@
 
     protected int domain = ClassConstantPool.DOMAIN_UNDEFINED;
 
-    ConstantPoolEntry(byte tag) {
+    protected final int globalIndex;
+
+    ConstantPoolEntry(byte tag, int globalIndex) {
         this.tag = tag;
+        this.globalIndex = globalIndex;
     }
 
     public abstract boolean equals(Object obj);
@@ -106,5 +109,9 @@
      */
     public boolean mustStartClassPool() {
         return mustStartClassPool;
+    }
+
+    public int getGlobalIndex() {
+        return globalIndex;
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/DeprecatedAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/DeprecatedAttribute.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/DeprecatedAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/DeprecatedAttribute.java Tue Apr 22 05:39:29 2008
@@ -58,4 +58,8 @@
         return "Deprecated Attribute";
     }
 
+    public boolean equals(Object obj) {
+        return this == obj;
+    }
+
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/EnclosingMethodAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/EnclosingMethodAttribute.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/EnclosingMethodAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/EnclosingMethodAttribute.java Tue Apr 22 05:39:29 2008
@@ -73,4 +73,8 @@
         return "EnclosingMethod";
     }
 
+    public boolean equals(Object obj) {
+        return this == obj;
+    }
+
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LineNumberTableAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LineNumberTableAttribute.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LineNumberTableAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LineNumberTableAttribute.java Tue Apr 22 05:39:29 2008
@@ -68,6 +68,11 @@
         return new ClassFileEntry[] { getAttributeName() };
     }
 
+
+    public boolean equals(Object obj) {
+        return this == obj;
+    }
+
     /*
      * (non-Javadoc)
      * 

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LocalVariableTableAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LocalVariableTableAttribute.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LocalVariableTableAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LocalVariableTableAttribute.java Tue Apr 22 05:39:29 2008
@@ -158,4 +158,8 @@
             lengths[index] = revisedLength;
         }
     }
+
+    public boolean equals(Object obj) {
+        return this == obj;
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LocalVariableTypeTableAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LocalVariableTypeTableAttribute.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LocalVariableTypeTableAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LocalVariableTypeTableAttribute.java Tue Apr 22 05:39:29 2008
@@ -79,4 +79,8 @@
                 + " varaibles";
     }
 
+    public boolean equals(Object obj) {
+        return this == obj;
+    }
+
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleAnnotationsAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleAnnotationsAttribute.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleAnnotationsAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleAnnotationsAttribute.java Tue Apr 22 05:39:29 2008
@@ -63,4 +63,7 @@
                 + " annotations";
     }
 
+    public boolean equals(Object obj) {
+        return this == obj;
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java Tue Apr 22 05:39:29 2008
@@ -100,4 +100,8 @@
 
     }
 
+    public boolean equals(Object obj) {
+        return this == obj;
+    }
+
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/SignatureAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/SignatureAttribute.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/SignatureAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/SignatureAttribute.java Tue Apr 22 05:39:29 2008
@@ -69,4 +69,8 @@
         return "Signature: " + signature;
     }
 
+
+    public boolean equals(Object obj) {
+        return this == obj;
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/AttributeLayoutTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/AttributeLayoutTest.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/AttributeLayoutTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/AttributeLayoutTest.java Tue Apr 22 05:39:29 2008
@@ -23,28 +23,34 @@
 import org.apache.harmony.unpack200.Pack200Exception;
 import org.apache.harmony.unpack200.Segment;
 import org.apache.harmony.unpack200.SegmentConstantPool;
+import org.apache.harmony.unpack200.bytecode.CPUTF8;
+import org.apache.harmony.unpack200.bytecode.ClassConstantPool;
+import org.apache.harmony.unpack200.bytecode.ClassFileEntry;
 
 public class AttributeLayoutTest extends TestCase {
 
     public class TestSegment extends Segment {
 
         public SegmentConstantPool getConstantPool() {
-            final Object[][] data = new Object[][] {
+            final ClassFileEntry[][] data = new ClassFileEntry[][] {
                     {}, // ALL
-                    { "Zero", "One", "Two", "Three", "Four", "Five", "Six",
-                            "Seven", "Eight", "Nine" }, // UTF-8
+                    { entry("Zero"), entry("One"), entry("Two"),
+                            entry("Three"), entry("Four"), entry("Five"),
+                            entry("Six"), entry("Seven"), entry("Eight"),
+                            entry("Nine") }, // UTF-8
                     {},
                     {},
                     {},
                     {},
                     {},
                     {},
-                    { "Eins", "Zwei", "Drei", "Vier", "Funf", "Sechs",
-                            "Sieben", "Acht", "Neun" }, // Signature
+                    { entry("Eins"), entry("Zwei"), entry("Drei"),
+                            entry("Vier"), entry("Funf"), entry("Sechs"),
+                            entry("Sieben"), entry("Acht"), entry("Neun") }, // Signature
             };
             return new SegmentConstantPool(null) {
 
-                public Object getValue(int cp, long index) {
+                public ClassFileEntry getValue(int cp, long index) {
                     if (index == -1)
                         return null;
                     return data[cp][(int) index];
@@ -52,6 +58,10 @@
 
             };
         }
+
+        private ClassFileEntry entry(String string) {
+            return new CPUTF8(string, ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ);
+        }
     }
 
     public void testBadData() {
@@ -70,8 +80,8 @@
                 AttributeLayout.CONTEXT_CLASS, "RU", 1);
         Segment segment = new TestSegment();
         assertNull(layout.getValue(-1, segment.getConstantPool()));
-        assertEquals("Zero", layout.getValue(0, segment.getConstantPool()));
-        assertEquals("One", layout.getValue(1, segment.getConstantPool()));
+        assertEquals("Zero", ((CPUTF8)layout.getValue(0, segment.getConstantPool())).underlyingString());
+        assertEquals("One", ((CPUTF8)layout.getValue(1, segment.getConstantPool())).underlyingString());
     }
 
     public void testLayoutRUN() throws Pack200Exception {
@@ -79,8 +89,8 @@
                 AttributeLayout.CONTEXT_CLASS, "RUN", 1);
         Segment segment = new TestSegment();
         assertNull(layout.getValue(0, segment.getConstantPool()));
-        assertEquals("Zero", layout.getValue(1, segment.getConstantPool()));
-        assertEquals("One", layout.getValue(2, segment.getConstantPool()));
+        assertEquals("Zero", ((CPUTF8)layout.getValue(1, segment.getConstantPool())).underlyingString());
+        assertEquals("One", ((CPUTF8)layout.getValue(2, segment.getConstantPool())).underlyingString());
     }
 
     public void testLayoutRS() throws Pack200Exception {
@@ -88,8 +98,8 @@
                 AttributeLayout.CONTEXT_CLASS, "RS", 1);
         Segment segment = new TestSegment();
         assertNull(layout.getValue(-1, segment.getConstantPool()));
-        assertEquals("Eins", layout.getValue(0, segment.getConstantPool()));
-        assertEquals("Zwei", layout.getValue(1, segment.getConstantPool()));
+        assertEquals("Eins", ((CPUTF8)layout.getValue(0, segment.getConstantPool())).underlyingString());
+        assertEquals("Zwei", ((CPUTF8)layout.getValue(1, segment.getConstantPool())).underlyingString());
     }
 
     public void testLayoutRSN() throws Pack200Exception {
@@ -97,8 +107,8 @@
                 AttributeLayout.CONTEXT_CLASS, "RSN", 1);
         Segment segment = new TestSegment();
         assertNull(layout.getValue(0, segment.getConstantPool()));
-        assertEquals("Eins", layout.getValue(1, segment.getConstantPool()));
-        assertEquals("Zwei", layout.getValue(2, segment.getConstantPool()));
+        assertEquals("Eins", ((CPUTF8)layout.getValue(1, segment.getConstantPool())).underlyingString());
+        assertEquals("Zwei", ((CPUTF8)layout.getValue(2, segment.getConstantPool())).underlyingString());
     }
 
     public void testGetCodec() throws Pack200Exception {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/BcBandsTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/BcBandsTest.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/BcBandsTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/BcBandsTest.java Tue Apr 22 05:39:29 2008
@@ -28,6 +28,18 @@
 import org.apache.harmony.unpack200.Pack200Exception;
 import org.apache.harmony.unpack200.Segment;
 import org.apache.harmony.unpack200.SegmentConstantPool;
+import org.apache.harmony.unpack200.bytecode.CPClass;
+import org.apache.harmony.unpack200.bytecode.CPDouble;
+import org.apache.harmony.unpack200.bytecode.CPFieldRef;
+import org.apache.harmony.unpack200.bytecode.CPFloat;
+import org.apache.harmony.unpack200.bytecode.CPInteger;
+import org.apache.harmony.unpack200.bytecode.CPInterfaceMethodRef;
+import org.apache.harmony.unpack200.bytecode.CPLong;
+import org.apache.harmony.unpack200.bytecode.CPMethodRef;
+import org.apache.harmony.unpack200.bytecode.CPNameAndType;
+import org.apache.harmony.unpack200.bytecode.CPString;
+import org.apache.harmony.unpack200.bytecode.CPUTF8;
+import org.apache.harmony.unpack200.bytecode.ClassConstantPool;
 
 /**
  * Tests for Pack200 bytecode bands
@@ -43,76 +55,68 @@
 
     public class MockCpBands extends CpBands {
 
+        private final CPUTF8 cpUTF8 = new CPUTF8("java/lang/String",
+                ClassConstantPool.DOMAIN_NORMALASCIIZ);
+        private final CPClass cpClass = new CPClass(cpUTF8, -1);
+        private final CPNameAndType descriptor = new CPNameAndType(new CPUTF8(
+                "Hello", ClassConstantPool.DOMAIN_NORMALASCIIZ), new CPUTF8(
+                "(a, b, c)", ClassConstantPool.DOMAIN_NORMALASCIIZ),
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, -1);
+
         public MockCpBands(Segment segment) {
             super(segment);
         }
 
-        public String[] getCpString() {
-            String[] classes = new String[100];
-            for (int index = 0; index < 100; index++) {
-                classes[index] = "java/lang/Stri:ng(J)";
-            }
-            return classes;
+        public CPString cpStringValue(int index) {
+            return new CPString(cpUTF8, index);
         }
 
-        public String[] getCpClass() {
-            return getCpString();
+        public CPInteger cpIntegerValue(int index) {
+            return new CPInteger(new Integer(21), index);
         }
 
-        public String[] getCpFieldClass() {
-            return getCpClass();
+        public CPClass cpClassValue(int index) {
+            return cpClass;
         }
 
-        public String[] getCpFieldDescriptor() {
-            return getCpString();
+        public CPFloat cpFloatValue(int index) {
+            return new CPFloat(new Float(2.5F), index);
         }
 
-        public String[] getCpMethodClass() {
-            return getCpClass();
+        public CPLong cpLongValue(int index) {
+            return new CPLong(new Long(21L), index);
         }
 
-        public String[] getCpMethodDescriptor() {
-            return getCpString();
+        public CPDouble cpDoubleValue(int index) {
+            return new CPDouble(new Double(2.5D), index);
         }
 
-        public String[] getCpIMethodClass() {
-            return getCpClass();
+        public CPFieldRef cpFieldValue(int index) {
+            return new CPFieldRef(cpClass, descriptor, index);
         }
 
-        public String[] getCpIMethodDescriptor() {
-            return getCpString();
+        public CPMethodRef cpMethodValue(int index) {
+            return new CPMethodRef(cpClass, descriptor, index);
         }
 
-        public int[] getCpInt() {
-            int[] elements = new int[100];
-            for (int index = 0; index < 100; index++) {
-                elements[index] = 1;
-            }
-            return elements;
+        public CPInterfaceMethodRef cpIMethodValue(int index) {
+            return new CPInterfaceMethodRef(cpClass, descriptor, index);
         }
 
-        public float[] getCpFloat() {
-            float[] elements = new float[100];
-            for (int index = 0; index < 100; index++) {
-                elements[index] = 1.0f;
-            }
-            return elements;
+        public String[] getCpClass() {
+            return new String[] {"Hello"};
+        }
+        
+        public String[] getCpFieldClass() {
+            return new String[]{};
         }
 
-        public long[] getCpLong() {
-            long[] elements = new long[100];
-            for (int index = 0; index < 100; index++) {
-                elements[index] = 1L;
-            }
-            return elements;
+        public String[] getCpMethodClass() {
+            return new String[]{};
         }
 
-        public double[] getCpDouble() {
-            double[] elements = new double[100];
-            for (int index = 0; index < 100; index++) {
-                elements[index] = 1.0D;
-            }
-            return elements;
+        public String[] getCpIMethodClass() {
+            return new String[]{};
         }
     }
 
@@ -157,18 +161,18 @@
             return descr;
         }
 
-        public String[] getClassThis() {
-            String[] thisClasses = new String[numClasses];
+        public int[] getClassThisInts() {
+            int[] thisClasses = new int[numClasses];
             for (int index = 0; index < numClasses; index++) {
-                thisClasses[index] = "java/lang/String";
+                thisClasses[index] = 0;
             }
             return thisClasses;
         }
 
-        public String[] getClassSuper() {
-            String[] superClasses = new String[numClasses];
+        public int[] getClassSuperInts() {
+            int[] superClasses = new int[numClasses];
             for (int index = 0; index < numClasses; index++) {
-                superClasses[index] = "java/lang/Object";
+                superClasses[index] = 0;
             }
             return superClasses;
         }
@@ -227,7 +231,7 @@
     /**
      * Test with single byte instructions that mean all other bands apart from
      * bc_codes will be empty.
-     * 
+     *
      * @throws IOException
      * @throws Pack200Exception
      */
@@ -255,7 +259,7 @@
 
     /**
      * Test with multiple classes but single byte instructions
-     * 
+     *
      * @throws IOException
      * @throws Pack200Exception
      */
@@ -276,7 +280,7 @@
     /**
      * Test with multiple classes and multiple methods but single byte
      * instructions
-     * 
+     *
      * @throws IOException
      * @throws Pack200Exception
      */
@@ -298,7 +302,7 @@
     /**
      * Test with codes that require entries in the bc_case_count and
      * bc_case_value bands
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -322,7 +326,7 @@
 
     /**
      * Test with codes that should require entries in the bc_byte band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -345,7 +349,7 @@
 
     /**
      * Test with codes that should require entries in the bc_short band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -363,7 +367,7 @@
 
     /**
      * Test with codes that should require entries in the bc_local band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -379,7 +383,7 @@
 
     /**
      * Test with codes that should require entries in the bc_label band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -422,7 +426,7 @@
 
     /**
      * Test with codes that should require entries in the bc_intref band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -438,7 +442,7 @@
 
     /**
      * Test with codes that should require entries in the bc_floatref band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -454,7 +458,7 @@
 
     /**
      * Test with codes that should require entries in the bc_longref band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -469,7 +473,7 @@
 
     /**
      * Test with codes that should require entries in the bc_doubleref band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -485,7 +489,7 @@
 
     /**
      * Test with codes that should require entries in the bc_stringref band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -501,7 +505,7 @@
 
     /**
      * Test with codes that should require entries in the bc_classref band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -517,7 +521,7 @@
 
     /**
      * Test with codes that should require entries in the bc_fieldref band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -533,7 +537,7 @@
 
     /**
      * Test with codes that should require entries in the bc_methodref band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -549,7 +553,7 @@
 
     /**
      * Test with codes that should require entries in the bc_imethodref band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -565,7 +569,7 @@
 
     /**
      * Test with codes that should require entries in the bc_thisfieldref band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -582,7 +586,7 @@
 
     /**
      * Test with codes that should require entries in the bc_superfield band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -599,7 +603,7 @@
 
     /**
      * Test with codes that should require entries in the bc_thismethod band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -616,7 +620,7 @@
 
     /**
      * Test with codes that should require entries in the bc_supermethod band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */
@@ -636,7 +640,7 @@
 
     /**
      * Test with codes that should require entries in the bc_initrefref band
-     * 
+     *
      * @throws Pack200Exception
      * @throws IOException
      */

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/CPUTF8Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/CPUTF8Test.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/CPUTF8Test.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/CPUTF8Test.java Tue Apr 22 05:39:29 2008
@@ -25,11 +25,11 @@
 
     public void testEquality() {
         CPUTF8 one = new CPUTF8("(III)V",
-                ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ);
+                ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ, 1);
         CPUTF8 two = new CPUTF8("((I[II)V",
-                ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ);
+                ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ, 2);
         CPUTF8 three = new CPUTF8("([III)V",
-                ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ);
+                ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ, 3);
         assertFalse(one.equals(two));
         assertFalse(one.equals(three));
         assertFalse(two.equals(three));

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ClassBandsTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ClassBandsTest.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ClassBandsTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ClassBandsTest.java Tue Apr 22 05:39:29 2008
@@ -26,7 +26,7 @@
 import org.apache.harmony.unpack200.Segment;
 
 /**
- * 
+ *
  */
 public class ClassBandsTest extends AbstractBandsTestCase {
 
@@ -112,12 +112,12 @@
         }
         ByteArrayInputStream in = new ByteArrayInputStream(bytes);
         classBands.unpack(in);
-        assertEquals(cpClasses[1], classBands.getClassThis()[0]);
-        assertEquals(cpClasses[2], classBands.getClassSuper()[0]);
-        assertEquals(1, classBands.getClassInterfaces().length);
-        assertEquals(2, classBands.getClassInterfaces()[0].length);
-        assertEquals(cpClasses[3], classBands.getClassInterfaces()[0][0]);
-        assertEquals(cpClasses[4], classBands.getClassInterfaces()[0][1]);
+        assertEquals(1, classBands.getClassThisInts()[0]);
+        assertEquals(2, classBands.getClassSuperInts()[0]);
+        assertEquals(1, classBands.getClassInterfacesInts().length);
+        assertEquals(2, classBands.getClassInterfacesInts()[0].length);
+        assertEquals(3, classBands.getClassInterfacesInts()[0][0]);
+        assertEquals(4, classBands.getClassInterfacesInts()[0][1]);
         cpClasses = null;
     }
 
@@ -152,8 +152,8 @@
         }
         ByteArrayInputStream in = new ByteArrayInputStream(bytes);
         classBands.unpack(in);
-        assertEquals(cpClasses[1], classBands.getClassThis()[0]);
-        assertEquals(cpClasses[2], classBands.getClassSuper()[0]);
+        assertEquals(1, classBands.getClassThisInts()[0]);
+        assertEquals(2, classBands.getClassSuperInts()[0]);
         assertEquals(1, classBands.getMethodDescr().length);
         assertEquals(3, classBands.getMethodDescr()[0].length);
         assertEquals(cpDescriptor[0], classBands.getMethodDescr()[0][0]);
@@ -162,10 +162,6 @@
 
         cpClasses = null;
         cpDescriptor = null;
-    }
-
-    public void testWithFields() {
-
     }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/CodeAttributeTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/CodeAttributeTest.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/CodeAttributeTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/CodeAttributeTest.java Tue Apr 22 05:39:29 2008
@@ -25,6 +25,11 @@
 import org.apache.harmony.unpack200.Segment;
 import org.apache.harmony.unpack200.SegmentConstantPool;
 import org.apache.harmony.unpack200.bytecode.ByteCode;
+import org.apache.harmony.unpack200.bytecode.CPFieldRef;
+import org.apache.harmony.unpack200.bytecode.CPMethodRef;
+import org.apache.harmony.unpack200.bytecode.CPString;
+import org.apache.harmony.unpack200.bytecode.CPUTF8;
+import org.apache.harmony.unpack200.bytecode.ClassConstantPool;
 import org.apache.harmony.unpack200.bytecode.CodeAttribute;
 import org.apache.harmony.unpack200.bytecode.LocalVariableTableAttribute;
 import org.apache.harmony.unpack200.bytecode.OperandManager;
@@ -54,28 +59,18 @@
             super(segment);
         }
 
-        public String[] getCpFieldClass() {
-            return new String[] { "Un", "Deux", "Trois", "Quatre", "Cinq",
-                    "Six", "Sept", "Huit", "Neuf" };
+        public CPFieldRef cpFieldValue(int index) {
+            return null;
         }
 
-        public String[] getCpFieldDescriptor() {
-            return new String[] { "Un:un", "Deux:deux", "Trois:trois" };
+        public CPString cpStringValue(int index) {
+            return new CPString(new CPUTF8("Hello", ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ), -1);
         }
 
-        public String[] getCpMethodClass() {
-            return new String[] { "Un", "Deux", "Trois", "Quatre", "Cinq",
-                    "Six", "Sept", "Huit", "Neuf" };
+        public CPMethodRef cpMethodValue(int index) {
+            return null;
         }
 
-        public String[] getCpMethodDescriptor() {
-            return new String[] { "Un:un", "Deux:deux", "Trois:trois" };
-        }
-
-        public String[] getCpString() {
-            return new String[] { "Un", "Deux", "Trois", "Quatre", "Cinq",
-                    "Six", "Sept", "Huit", "Neuf" };
-        }
     }
 
     public class MockOperandManager extends OperandManager {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ICTupleTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ICTupleTest.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ICTupleTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ICTupleTest.java Tue Apr 22 05:39:29 2008
@@ -17,41 +17,47 @@
 package org.apache.harmony.unpack200.tests;
 
 import junit.framework.TestCase;
+
 import org.apache.harmony.unpack200.IcTuple;
 
 public class ICTupleTest extends TestCase {
 
     public void testPredictedClassTupleParsing() {
         IcTuple tuple = new IcTuple(
-                "orw/SimpleHelloWorld$SimpleHelloWorldInner", 0, null, null);
+                "orw/SimpleHelloWorld$SimpleHelloWorldInner", 0, null, null,
+                -1, -1, -1);
         assertEquals("SimpleHelloWorldInner", tuple.simpleClassName());
         assertEquals("orw/SimpleHelloWorld", tuple.outerClassString());
 
-        tuple = new IcTuple("java/util/AbstractList$2$Local", 0, null, null);
+        tuple = new IcTuple("java/util/AbstractList$2$Local", 0, null, null,
+                -1, -1, -1);
         assertEquals("Local", tuple.simpleClassName());
         assertEquals("java/util/AbstractList$2", tuple.outerClassString());
 
-        tuple = new IcTuple("java/util/AbstractList#2#Local", 0, null, null);
+        tuple = new IcTuple("java/util/AbstractList#2#Local", 0, null, null,
+                -1, -1, -1);
         assertEquals("Local", tuple.simpleClassName());
         assertEquals("java/util/AbstractList$2", tuple.outerClassString());
 
-        tuple = new IcTuple("java/util/AbstractList$1", 0, null, null);
+        tuple = new IcTuple("java/util/AbstractList$1", 0, null, null, -1, -1,
+                -1);
         assertEquals("1", tuple.simpleClassName());
         assertEquals("java/util/AbstractList", tuple.outerClassString());
     }
 
     public void testExplicitClassTupleParsing() {
         IcTuple tuple = new IcTuple("Foo$$2$Local", IcTuple.NESTED_CLASS_FLAG,
-                null, "$2$Local");
+                null, "$2$Local", -1, -1, -1);
         assertEquals("$2$Local", tuple.simpleClassName());
         assertEquals("Foo$$2", tuple.outerClassString());
 
         tuple = new IcTuple("Red$Herring", IcTuple.NESTED_CLASS_FLAG,
-                "Red$Herring", null);
+                "Red$Herring", null, -1, -1, -1);
         assertEquals("Herring", tuple.simpleClassName());
         assertEquals("Red$Herring", tuple.outerClassString());
 
-        tuple = new IcTuple("X$1$Q", IcTuple.NESTED_CLASS_FLAG, "X$1", "Q");
+        tuple = new IcTuple("X$1$Q", IcTuple.NESTED_CLASS_FLAG, "X$1", "Q", -1,
+                -1, -1);
         assertEquals("Q", tuple.simpleClassName());
         assertEquals("X$1", tuple.outerClassString());
     }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/SegmentTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/SegmentTest.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/SegmentTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/SegmentTest.java Tue Apr 22 05:39:29 2008
@@ -94,52 +94,30 @@
         assertEquals(line, "Hello world");
         reader.close();
 
-        process = Runtime
+        Process process2 = Runtime
                 .getRuntime()
                 .exec(
-                        "javap -c -classpath "
+                        "javap -c -verbose -classpath "
                                 + file.getName()
                                 + " org.apache.harmony.archive.tests.internal.pack200.HelloWorld",
                         new String[] {}, file.getParentFile());
-        reader = new BufferedReader(new InputStreamReader(process
+        BufferedReader reader1 = new BufferedReader(new InputStreamReader(process2
                 .getInputStream()));
         InputStream javapCompareFile = Segment.class
                 .getResourceAsStream("/org/apache/harmony/pack200/tests/HelloWorldJavap.out");
         BufferedReader reader2 = new BufferedReader(new InputStreamReader(
                 javapCompareFile));
-        line = reader.readLine();
+        String line1 = reader1.readLine();
         String line2 = reader2.readLine();
         int i = 1;
-        while (line != null || line2 != null) {
-            compareLineWithoutDigits("Javap output differs at line " + i,
-                    line2, line);
-            line = reader.readLine();
+        while (line1 != null || line2 != null) {
+            assertEquals(line2, line1);
+            line1 = reader1.readLine();
             line2 = reader2.readLine();
             i++;
         }
-        reader.close();
+        reader1.close();
         reader2.close();
-    }
-
-    // Compare without digits for now as we're not currently sorting the
-    // constant pool correctly
-    private void compareLineWithoutDigits(String message, String expectedLine,
-            String actualLine) {
-        String expected = "";
-        char[] chars = expectedLine.toCharArray();
-        for (int i = 0; i < chars.length; i++) {
-            if (!Character.isDigit(chars[i])) {
-                expected += chars[i];
-            }
-        }
-        String actual = "";
-        char[] chars2 = actualLine.toCharArray();
-        for (int i = 0; i < chars2.length; i++) {
-            if (!Character.isDigit(chars2[i])) {
-                actual += chars2[i];
-            }
-        }
-        assertEquals(message, expected, actual);
     }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/bytecode/ClassFileEntryTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/bytecode/ClassFileEntryTest.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/bytecode/ClassFileEntryTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/bytecode/ClassFileEntryTest.java Tue Apr 22 05:39:29 2008
@@ -32,11 +32,11 @@
 
     public void testUTF8() {
         CPUTF8 u1 = new CPUTF8(
-                new String("thing"), ClassConstantPool.DOMAIN_NORMALASCIIZ); //$NON-NLS-1$
+                new String("thing"), ClassConstantPool.DOMAIN_NORMALASCIIZ, 1); //$NON-NLS-1$
         CPUTF8 u2 = new CPUTF8(
-                new String("thing"), ClassConstantPool.DOMAIN_NORMALASCIIZ); //$NON-NLS-1$
+                new String("thing"), ClassConstantPool.DOMAIN_NORMALASCIIZ, 1); //$NON-NLS-1$
         CPUTF8 u3 = new CPUTF8(
-                new String("otherthing"), ClassConstantPool.DOMAIN_NORMALASCIIZ); //$NON-NLS-1$
+                new String("otherthing"), ClassConstantPool.DOMAIN_NORMALASCIIZ, 2); //$NON-NLS-1$
         checkEquality(u1, u2, "thing", u3);
     }
 
@@ -54,67 +54,67 @@
     public void testSourceAttribute() {
         SourceFileAttribute sfa1 = new SourceFileAttribute(
                 new CPUTF8(
-                        new String("Thing.java"), ClassConstantPool.DOMAIN_NORMALASCIIZ)); //$NON-NLS-1$
+                        new String("Thing.java"), ClassConstantPool.DOMAIN_NORMALASCIIZ, 1)); //$NON-NLS-1$
         SourceFileAttribute sfa2 = new SourceFileAttribute(
                 new CPUTF8(
-                        new String("Thing.java"), ClassConstantPool.DOMAIN_NORMALASCIIZ)); //$NON-NLS-1$
+                        new String("Thing.java"), ClassConstantPool.DOMAIN_NORMALASCIIZ, 1)); //$NON-NLS-1$
         SourceFileAttribute sfa3 = new SourceFileAttribute(
                 new CPUTF8(
-                        new String("OtherThing.java"), ClassConstantPool.DOMAIN_NORMALASCIIZ)); //$NON-NLS-1$
+                        new String("OtherThing.java"), ClassConstantPool.DOMAIN_NORMALASCIIZ, 2)); //$NON-NLS-1$
         checkEquality(sfa1, sfa2, "Thing.java", sfa3); //$NON-NLS-1$
     }
 
     public void testCPInteger() {
-        CPInteger cp1 = new CPInteger(new Integer(3));
-        CPInteger cp2 = new CPInteger(new Integer(3));
-        CPInteger cp3 = new CPInteger(new Integer(5));
+        CPInteger cp1 = new CPInteger(new Integer(3), 3);
+        CPInteger cp2 = new CPInteger(new Integer(3), 3);
+        CPInteger cp3 = new CPInteger(new Integer(5), 5);
         checkEquality(cp1, cp2, "3", cp3); //$NON-NLS-1$
     }
 
     public void testCPLong() {
-        CPLong cp1 = new CPLong(new Long(3));
-        CPLong cp2 = new CPLong(new Long(3));
-        CPLong cp3 = new CPLong(new Long(5));
+        CPLong cp1 = new CPLong(new Long(3), 3);
+        CPLong cp2 = new CPLong(new Long(3), 3);
+        CPLong cp3 = new CPLong(new Long(5), 5);
         checkEquality(cp1, cp2, "3", cp3); //$NON-NLS-1$
     }
 
     public void testCPDouble() {
-        CPDouble cp1 = new CPDouble(new Double(3));
-        CPDouble cp2 = new CPDouble(new Double(3));
-        CPDouble cp3 = new CPDouble(new Double(5));
+        CPDouble cp1 = new CPDouble(new Double(3), 3);
+        CPDouble cp2 = new CPDouble(new Double(3), 3);
+        CPDouble cp3 = new CPDouble(new Double(5), 5);
         checkEquality(cp1, cp2, "3", cp3); //$NON-NLS-1$
     }
 
     public void testCPFloat() {
-        CPFloat cp1 = new CPFloat(new Float(3));
-        CPFloat cp2 = new CPFloat(new Float(3));
-        CPFloat cp3 = new CPFloat(new Float(5));
+        CPFloat cp1 = new CPFloat(new Float(3), 3);
+        CPFloat cp2 = new CPFloat(new Float(3), 3);
+        CPFloat cp3 = new CPFloat(new Float(5), 5);
         checkEquality(cp1, cp2, "3", cp3); //$NON-NLS-1$
     }
 
     public void testCPString() {
         CPString cp1 = new CPString(new CPUTF8(new String("3"),
-                ClassConstantPool.DOMAIN_NORMALASCIIZ));
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, 3), 3);
         CPString cp2 = new CPString(new CPUTF8(new String("3"),
-                ClassConstantPool.DOMAIN_NORMALASCIIZ));
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, 3), 3);
         CPString cp3 = new CPString(new CPUTF8(new String("5"),
-                ClassConstantPool.DOMAIN_NORMALASCIIZ));
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, 5), 5);
         checkEquality(cp1, cp2, "3", cp3); //$NON-NLS-1$
     }
 
     public void testCPField() {
         CPMember cp1 = new CPMember(new CPUTF8("Name",
-                ClassConstantPool.DOMAIN_NORMALASCIIZ), new CPUTF8("I",
-                ClassConstantPool.DOMAIN_NORMALASCIIZ), 0, null);
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, 3), new CPUTF8("I",
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, 4), 0, null);
         CPMember cp2 = new CPMember(new CPUTF8("Name",
-                ClassConstantPool.DOMAIN_NORMALASCIIZ), new CPUTF8("I",
-                ClassConstantPool.DOMAIN_NORMALASCIIZ), 0, null);
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, 3), new CPUTF8("I",
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, 4), 0, null);
         CPMember cp3 = new CPMember(new CPUTF8("Name",
-                ClassConstantPool.DOMAIN_NORMALASCIIZ), new CPUTF8("Z",
-                ClassConstantPool.DOMAIN_NORMALASCIIZ), 0, null);
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, 3), new CPUTF8("Z",
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, 5), 0, null);
         CPMember cp4 = new CPMember(new CPUTF8("GName",
-                ClassConstantPool.DOMAIN_NORMALASCIIZ), new CPUTF8("I",
-                ClassConstantPool.DOMAIN_NORMALASCIIZ), 0, null);
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, 6), new CPUTF8("I",
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, 4), 0, null);
         checkEquality(cp1, cp2, "Name", cp3); //$NON-NLS-1$
         checkEquality(cp1, cp2, "I", cp4); //$NON-NLS-1$
     }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/bytecode/ConstantPoolTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/bytecode/ConstantPoolTest.java?rev=650483&r1=650482&r2=650483&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/bytecode/ConstantPoolTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/bytecode/ConstantPoolTest.java Tue Apr 22 05:39:29 2008
@@ -33,8 +33,8 @@
     }
 
     public void testDuplicateUTF8() {
-        CPUTF8 u1 = new CPUTF8("thing", ClassConstantPool.DOMAIN_NORMALASCIIZ);
-        CPUTF8 u2 = new CPUTF8("thing", ClassConstantPool.DOMAIN_NORMALASCIIZ);
+        CPUTF8 u1 = new CPUTF8("thing", ClassConstantPool.DOMAIN_NORMALASCIIZ, 1);
+        CPUTF8 u2 = new CPUTF8("thing", ClassConstantPool.DOMAIN_NORMALASCIIZ, 1);
         pool.add(u1);
         pool.add(u2);
         assertEquals(1, pool.size());
@@ -42,22 +42,24 @@
 
     public void testDuplicateField() {
         CPMember cp1 = new CPMember(new CPUTF8("name",
-                ClassConstantPool.DOMAIN_NORMALASCIIZ), new CPUTF8("I",
-                ClassConstantPool.DOMAIN_NORMALASCIIZ), 0, null);
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, 1), new CPUTF8("I",
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, 2), 0, null);
         pool.add(cp1);
+        pool.addNestedEntries();
         assertEquals(2, pool.size());
         CPMember cp2 = new CPMember(new CPUTF8("name",
-                ClassConstantPool.DOMAIN_NORMALASCIIZ), new CPUTF8("I",
-                ClassConstantPool.DOMAIN_NORMALASCIIZ), 0, null);
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, 1), new CPUTF8("I",
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, 2), 0, null);
         pool.add(cp2);
+        pool.addNestedEntries();
         assertEquals(2, pool.size());
     }
 
     public void testIndex() {
         pool
                 .add(new CPUTF8("OtherThing",
-                        ClassConstantPool.DOMAIN_NORMALASCIIZ));
-        CPUTF8 u1 = new CPUTF8("thing", ClassConstantPool.DOMAIN_NORMALASCIIZ);
+                        ClassConstantPool.DOMAIN_NORMALASCIIZ, 1));
+        CPUTF8 u1 = new CPUTF8("thing", ClassConstantPool.DOMAIN_NORMALASCIIZ, 2);
         pool.add(u1);
         pool.resolve(new Segment());
         assertTrue(pool.indexOf(u1) > 0);
@@ -65,9 +67,9 @@
 
     public void testAllClasses() {
         pool.add(new CPClass(new CPUTF8("RandomClass",
-                ClassConstantPool.DOMAIN_NORMALASCIIZ)));
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, 1), 10));
         pool.add(new CPClass(new CPUTF8("RandomClass2",
-                ClassConstantPool.DOMAIN_NORMALASCIIZ)));
+                ClassConstantPool.DOMAIN_NORMALASCIIZ, 2), 20));
         assertEquals(2, pool.allClasses().size());
     }
 }

Added: harmony/enhanced/classlib/trunk/modules/pack200/src/test/resources/org/apache/harmony/pack200/tests/HelloWorldJavap.out
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/resources/org/apache/harmony/pack200/tests/HelloWorldJavap.out?rev=650483&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/resources/org/apache/harmony/pack200/tests/HelloWorldJavap.out (added)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/resources/org/apache/harmony/pack200/tests/HelloWorldJavap.out Tue Apr 22 05:39:29 2008
@@ -0,0 +1,164 @@
+Compiled from "HelloWorld.java"
+public class org.apache.harmony.archive.tests.internal.pack200.HelloWorld extends java.lang.Object
+  SourceFile: "HelloWorld.java"
+  minor version: 0
+  major version: 48
+  Constant pool:
+const #1 = float	2.718f;
+const #2 = float	3.142f;
+const #3 = String	#8;	//  Hello world
+const #4 = Asciz	()V;
+const #5 = Asciz	<init>;
+const #6 = Asciz	D;
+const #7 = Asciz	F;
+const #8 = Asciz	Hello world;
+const #9 = Asciz	I;
+const #10 = Asciz	J;
+const #11 = Asciz	a;
+const #12 = Asciz	args;
+const #13 = Asciz	b;
+const #14 = Asciz	c;
+const #15 = Asciz	d;
+const #16 = Asciz	f;
+const #17 = Asciz	g;
+const #18 = Asciz	i;
+const #19 = Asciz	j;
+const #20 = Asciz	java/io/PrintStream;
+const #21 = Asciz	java/lang/Object;
+const #22 = Asciz	java/lang/System;
+const #23 = Asciz	k;
+const #24 = Asciz	l;
+const #25 = Asciz	main;
+const #26 = Asciz	method;
+const #27 = Asciz	org/apache/harmony/archive/tests/internal/pack200/HelloWorld;
+const #28 = Asciz	out;
+const #29 = Asciz	println;
+const #30 = Asciz	this;
+const #31 = long	299792458l;
+const #33 = double	4.0d;
+const #35 = class	#20;	//  java/io/PrintStream
+const #36 = class	#21;	//  java/lang/Object
+const #37 = class	#22;	//  java/lang/System
+const #38 = class	#27;	//  org/apache/harmony/archive/tests/internal/pack200/HelloWorld
+const #39 = Asciz	Ljava/io/PrintStream;;
+const #40 = Asciz	[Ljava/lang/String;;
+const #41 = Asciz	Lorg/apache/harmony/archive/tests/internal/pack200/HelloWorld;;
+const #42 = Asciz	(Ljava/lang/String;)V;
+const #43 = Asciz	([Ljava/lang/String;)V;
+const #44 = Asciz	(III)[[Lorg/apache/harmony/archive/tests/internal/pack200/HelloWorld;;
+const #45 = NameAndType	#15:#6;//  d:D
+const #46 = NameAndType	#16:#7;//  f:F
+const #47 = NameAndType	#17:#7;//  g:F
+const #48 = NameAndType	#18:#9;//  i:I
+const #49 = NameAndType	#19:#9;//  j:I
+const #50 = NameAndType	#23:#9;//  k:I
+const #51 = NameAndType	#24:#10;//  l:J
+const #52 = NameAndType	#28:#39;//  out:Ljava/io/PrintStream;
+const #53 = NameAndType	#5:#4;//  "<init>":()V
+const #54 = NameAndType	#29:#42;//  println:(Ljava/lang/String;)V
+const #55 = Field	#37.#52;	//  java/lang/System.out:Ljava/io/PrintStream;
+const #56 = Field	#38.#45;	//  org/apache/harmony/archive/tests/internal/pack200/HelloWorld.d:D
+const #57 = Field	#38.#46;	//  org/apache/harmony/archive/tests/internal/pack200/HelloWorld.f:F
+const #58 = Field	#38.#47;	//  org/apache/harmony/archive/tests/internal/pack200/HelloWorld.g:F
+const #59 = Field	#38.#48;	//  org/apache/harmony/archive/tests/internal/pack200/HelloWorld.i:I
+const #60 = Field	#38.#49;	//  org/apache/harmony/archive/tests/internal/pack200/HelloWorld.j:I
+const #61 = Field	#38.#50;	//  org/apache/harmony/archive/tests/internal/pack200/HelloWorld.k:I
+const #62 = Field	#38.#51;	//  org/apache/harmony/archive/tests/internal/pack200/HelloWorld.l:J
+const #63 = Method	#35.#54;	//  java/io/PrintStream.println:(Ljava/lang/String;)V
+const #64 = Method	#36.#53;	//  java/lang/Object."<init>":()V
+const #65 = Asciz	Code;
+const #66 = Asciz	HelloWorld.java;
+const #67 = Asciz	LineNumberTable;
+const #68 = Asciz	LocalVariableTable;
+const #69 = Asciz	SourceFile;
+
+{
+int i;
+
+
+int j;
+
+
+int k;
+
+
+float f;
+
+
+float g;
+
+
+long l;
+
+
+double d;
+
+
+public org.apache.harmony.archive.tests.internal.pack200.HelloWorld();
+  Code:
+   Stack=3, Locals=1, Args_size=1
+   0:	aload_0
+   1:	invokespecial	#64; //Method java/lang/Object."<init>":()V
+   4:	aload_0
+   5:	bipush	97
+   7:	putfield	#59; //Field i:I
+   10:	aload_0
+   11:	bipush	42
+   13:	putfield	#60; //Field j:I
+   16:	aload_0
+   17:	sipush	12345
+   20:	putfield	#61; //Field k:I
+   23:	aload_0
+   24:	ldc	#2; //float 3.142f
+   26:	putfield	#57; //Field f:F
+   29:	aload_0
+   30:	ldc	#1; //float 2.718f
+   32:	putfield	#58; //Field g:F
+   35:	aload_0
+   36:	ldc2_w	#31; //long 299792458l
+   39:	putfield	#62; //Field l:J
+   42:	aload_0
+   43:	ldc2_w	#33; //double 4.0d
+   46:	putfield	#56; //Field d:D
+   49:	return
+  LineNumberTable: 
+   line 24: 0
+   line 25: 4
+   line 26: 23
+   line 27: 35
+   line 28: 42
+   line 24: 49
+  LocalVariableTable: 
+   Start  Length  Slot  Name   Signature
+   0      50      0    this       Lorg/apache/harmony/archive/tests/internal/pack200/HelloWorld;
+
+public static void main(java.lang.String[]);
+  Code:
+   Stack=2, Locals=1, Args_size=1
+   0:	getstatic	#55; //Field java/lang/System.out:Ljava/io/PrintStream;
+   3:	ldc	#3; //String Hello world
+   5:	invokevirtual	#63; //Method java/io/PrintStream.println:(Ljava/lang/String;)V
+   8:	return
+  LineNumberTable: 
+   line 30: 0
+   line 31: 8
+  LocalVariableTable: 
+   Start  Length  Slot  Name   Signature
+   0      9      0    args       [Ljava/lang/String;
+
+public org.apache.harmony.archive.tests.internal.pack200.HelloWorld[][] method(int, int, int);
+  Code:
+   Stack=1, Locals=4, Args_size=4
+   0:	aconst_null
+   1:	areturn
+  LineNumberTable: 
+   line 33: 0
+  LocalVariableTable: 
+   Start  Length  Slot  Name   Signature
+   0      2      0    this       Lorg/apache/harmony/archive/tests/internal/pack200/HelloWorld;
+   0      2      1    a       I
+   0      2      2    b       I
+   0      2      3    c       I
+
+}
+



Mime
View raw message