harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r999573 [3/4] - in /harmony/enhanced/java/branches/mrh: ./ classlib/ classlib/depends/build/ classlib/depends/files/ classlib/depends/jars/ classlib/depends/manifests/icu4j_4.2.1/META-INF/ classlib/depends/manifests/icu4j_4.4.1.1/ classlib/...
Date Tue, 21 Sep 2010 19:46:00 GMT
Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java Tue Sep 21 19:45:57 2010
@@ -108,7 +108,7 @@ public class Segment implements ClassVis
         PackingUtils.log("Setup file bands for the segment");
         fileBands = new FileBands(cpBands, segmentHeader, options, segmentUnit, effort);
 
-        processClasses(segmentUnit);
+        processClasses(segmentUnit, nonStandardAttributePrototypes);
 
         cpBands.finaliseBands();
         attributeDefinitionBands.finaliseBands();
@@ -124,11 +124,15 @@ public class Segment implements ClassVis
         ByteArrayOutputStream bandsOutputStream = new ByteArrayOutputStream();
 
         PackingUtils.log("Packing...");
+        int finalNumberOfClasses = classBands.numClassesProcessed();
+        segmentHeader.setClass_count(finalNumberOfClasses);
         cpBands.pack(bandsOutputStream);
-        attributeDefinitionBands.pack(bandsOutputStream);
-        icBands.pack(bandsOutputStream);
-        classBands.pack(bandsOutputStream);
-        bcBands.pack(bandsOutputStream);
+        if(finalNumberOfClasses > 0) {
+            attributeDefinitionBands.pack(bandsOutputStream);
+            icBands.pack(bandsOutputStream);
+            classBands.pack(bandsOutputStream);
+            bcBands.pack(bandsOutputStream);
+        }
         fileBands.pack(bandsOutputStream);
 
         ByteArrayOutputStream headerOutputStream = new ByteArrayOutputStream();
@@ -147,7 +151,7 @@ public class Segment implements ClassVis
                 + segmentUnit.getPackedByteAmount() + " bytes");
     }
 
-    private void processClasses(SegmentUnit segmentUnit) throws Pack200Exception {
+    private void processClasses(SegmentUnit segmentUnit, Attribute[] attributes) throws Pack200Exception {
         segmentHeader.setClass_count(segmentUnit.classListSize());
         for (Iterator iterator = segmentUnit.getClassList().iterator(); iterator.hasNext();) {
             Pack200ClassReader classReader = (Pack200ClassReader) iterator
@@ -158,12 +162,14 @@ public class Segment implements ClassVis
                 flags |= ClassReader.SKIP_DEBUG;
             }
             try {
-                classReader.accept(this, flags);
+                classReader.accept(this, attributes, flags);
             } catch (PassException pe) {
                 // Pass this class through as-is rather than packing it
                 // TODO: probably need to deal with any inner classes
                 classBands.removeCurrentClass();
                 String name = classReader.getFileName();
+                options.addPassFile(name);
+                cpBands.addCPUtf8(name);
                 boolean found = false;
                 for (Iterator iterator2 = segmentUnit.getFileList().iterator(); iterator2
                         .hasNext();) {
@@ -458,43 +464,8 @@ public class Segment implements ClassVis
                 name = "";
             }
             nameRU.add(name);
-            addValueAndTag(value);
+            addValueAndTag(value, T, values);
         }
-
-        private void addValueAndTag(Object value) {
-            if(value instanceof Integer) {
-                T.add("I");
-                values.add(value);
-            } else if (value instanceof Double) {
-                T.add("D");
-                values.add(value);
-            } else if (value instanceof Float) {
-                T.add("F");
-                values.add(value);
-            } else if (value instanceof Long) {
-                T.add("J");
-                values.add(value);
-            } else if (value instanceof Byte) {
-                T.add("B");
-                values.add(new Integer(((Byte)value).intValue()));
-            } else if (value instanceof Character) {
-                T.add("C");
-                values.add(new Integer(((Character)value).charValue()));
-            } else if (value instanceof Short) {
-                T.add("S");
-                values.add(new Integer(((Short)value).intValue()));
-            } else if (value instanceof Boolean) {
-                T.add("Z");
-                values.add(new Integer(((Boolean)value).booleanValue() ? 1 : 0));
-            } else if (value instanceof String) {
-                T.add("s");
-                values.add(value);
-            } else if (value instanceof Type) {
-                T.add("c");
-                values.add(((Type)value).toString());
-            }
-        }
-
         public AnnotationVisitor visitAnnotation(String name, String desc) {
             T.add("@");
             if (name == null) {
@@ -508,7 +479,7 @@ public class Segment implements ClassVis
                     Integer numPairs = (Integer) nestPairN.remove(nestPairN.size() - 1);
                     nestPairN.add(new Integer(numPairs.intValue() + 1));
                     nestNameRU.add(name);
-                    addValueAndTag(value);
+                    addValueAndTag(value, T, values);
                 }
 
                 public AnnotationVisitor visitAnnotation(String arg0,
@@ -543,38 +514,7 @@ public class Segment implements ClassVis
             }
             nameRU.add(name);
             caseArrayN.add(new Integer(0));
-            return new AnnotationVisitor() {
-                public void visit(String name, Object value) {
-                    Integer numCases = (Integer) caseArrayN.remove(caseArrayN.size() - 1);
-                    caseArrayN.add(new Integer(numCases.intValue() + 1));
-                    if (name == null) {
-                        name = "";
-                    }
-                    nameRU.add(name);
-                    addValueAndTag(value);
-                }
-
-                public AnnotationVisitor visitAnnotation(String arg0,
-                        String arg1) {
-                    throw new RuntimeException("Not yet supported");
-                }
-
-                public AnnotationVisitor visitArray(String arg0) {
-                    throw new RuntimeException("Not yet supported");
-//                    return null;
-                }
-
-                public void visitEnd() {
-                }
-
-                public void visitEnum(String name, String desc, String value) {
-                    Integer numCases = (Integer) caseArrayN.remove(caseArrayN.size() - 1);
-                    caseArrayN.add(new Integer(numCases.intValue() + 1));
-                    T.add("e");
-                    values.add(desc);
-                    values.add(value);
-                }
-            };
+            return new ArrayVisitor(caseArrayN, T, nameRU, values);
         }
 
         public void visitEnd() {
@@ -597,6 +537,58 @@ public class Segment implements ClassVis
             values.add(value);
         }
     }
+    
+    public class ArrayVisitor implements AnnotationVisitor  {
+        
+        private int indexInCaseArrayN;
+        private List caseArrayN;
+        private List values;
+        private List nameRU;
+        private List T;
+
+        public ArrayVisitor(List caseArrayN, List T, List nameRU, List values) {
+            this.caseArrayN = caseArrayN;
+            this.T = T;
+            this.nameRU = nameRU;
+            this.values = values;
+            this.indexInCaseArrayN = caseArrayN.size() - 1;
+        }
+        
+        public void visit(String name, Object value) {
+            Integer numCases = (Integer) caseArrayN.remove(indexInCaseArrayN);
+            caseArrayN.add(indexInCaseArrayN, new Integer(numCases.intValue() + 1));
+            if (name == null) {
+                name = "";
+            }
+            addValueAndTag(value, T, values);
+        }
+
+        public AnnotationVisitor visitAnnotation(String arg0,
+                String arg1) {
+            throw new RuntimeException("Not yet supported");
+        }
+
+        public AnnotationVisitor visitArray(String name) {
+            T.add("[");
+            if (name == null) {
+                name = "";
+            }
+            nameRU.add(name);
+            caseArrayN.add(new Integer(0));
+            return new ArrayVisitor(caseArrayN, T, nameRU, values);
+        }
+
+        public void visitEnd() {
+        }
+
+        public void visitEnum(String name, String desc, String value) {
+            Integer numCases = (Integer) caseArrayN.remove(caseArrayN.size() - 1);
+            caseArrayN.add(new Integer(numCases.intValue() + 1));
+            T.add("e");
+            values.add(desc);
+            values.add(value);
+        }
+    }
 
     /**
      * SegmentFieldVisitor implements <code>FieldVisitor</code> to visit the
@@ -639,6 +631,42 @@ public class Segment implements ClassVis
         }
     }
 
+    // helper method for annotation visitors
+    private void addValueAndTag(Object value, List T, List values) {
+        if(value instanceof Integer) {
+            T.add("I");
+            values.add(value);
+        } else if (value instanceof Double) {
+            T.add("D");
+            values.add(value);
+        } else if (value instanceof Float) {
+            T.add("F");
+            values.add(value);
+        } else if (value instanceof Long) {
+            T.add("J");
+            values.add(value);
+        } else if (value instanceof Byte) {
+            T.add("B");
+            values.add(new Integer(((Byte)value).intValue()));
+        } else if (value instanceof Character) {
+            T.add("C");
+            values.add(new Integer(((Character)value).charValue()));
+        } else if (value instanceof Short) {
+            T.add("S");
+            values.add(new Integer(((Short)value).intValue()));
+        } else if (value instanceof Boolean) {
+            T.add("Z");
+            values.add(new Integer(((Boolean)value).booleanValue() ? 1 : 0));
+        } else if (value instanceof String) {
+            T.add("s");
+            values.add(value);
+        } else if (value instanceof Type) {
+            T.add("c");
+            values.add(((Type)value).toString());
+        }
+    }
+
+
     public boolean lastConstantHadWideIndex() {
         return currentClassReader.lastConstantHadWideIndex();
     }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java Tue Sep 21 19:45:57 2010
@@ -64,8 +64,8 @@ public class SegmentHeader extends BandS
     private int file_count;
 
     private boolean deflate_hint;
-    private boolean have_file_modtime = true;
-    private boolean have_file_options = true;
+    private final boolean have_file_modtime = true;
+    private final boolean have_file_options = true;
     private boolean have_file_size_hi;
     private boolean have_class_flags_hi;
     private boolean have_field_flags_hi;
@@ -190,22 +190,6 @@ public class SegmentHeader extends BandS
         this.have_all_code_flags = have_all_code_flags;
     }
 
-    public void setArchive_size_hi(int archive_size_hi) {
-        this.archive_size_hi = archive_size_hi;
-    }
-
-    public void setArchive_size_lo(int archive_size_lo) {
-        this.archive_size_lo = archive_size_lo;
-    }
-
-    public void setArchive_next_count(int archive_next_count) {
-        this.archive_next_count = archive_next_count;
-    }
-
-    public void setArchive_modtime(int archive_modtime) {
-        this.archive_modtime = archive_modtime;
-    }
-
     public int getArchive_modtime() {
         return archive_modtime;
     }
@@ -218,18 +202,6 @@ public class SegmentHeader extends BandS
         this.deflate_hint = deflate_hint;
     }
 
-    public void setHave_file_modtime(boolean have_file_modtime) {
-        this.have_file_modtime = have_file_modtime;
-    }
-
-    public void setHave_file_options(boolean have_file_options) {
-        this.have_file_options = have_file_options;
-    }
-
-    public void setHave_file_size_hi(boolean have_file_size_hi) {
-        this.have_file_size_hi = have_file_size_hi;
-    }
-
     public void setHave_class_flags_hi(boolean have_class_flags_hi) {
         this.have_class_flags_hi = have_class_flags_hi;
     }
@@ -361,10 +333,6 @@ public class SegmentHeader extends BandS
         }
     }
 
-    public int getDefaultMinorVersion() {
-        return 0;
-    }
-
     public int getDefaultMajorVersion() {
         return majverCounter.getMostCommon();
     }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/Archive.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/Archive.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/Archive.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/Archive.java Tue Sep 21 19:45:57 2010
@@ -187,8 +187,11 @@ public class Archive {
             }
         }
         if (removePackFile) {
-            File file = new File(inputFileName);
-            boolean deleted = file.delete();
+            boolean deleted = false;
+            if(inputFileName != null) {
+                File file = new File(inputFileName);
+                deleted = file.delete();
+            }
             if (!deleted) {
                 throw new Pack200Exception("Failed to delete the input file.");
             }
@@ -234,7 +237,7 @@ public class Archive {
 
     public void setLogFile(String logFileName, boolean append)
             throws FileNotFoundException {
-        logFile = new FileOutputStream(logFileName, true);
+        logFile = new FileOutputStream(logFileName, append);
     }
 
     public void setDeflateHint(boolean deflateHint) {

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/AttributeLayout.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/AttributeLayout.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/AttributeLayout.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/AttributeLayout.java Tue Sep 21 19:45:57 2010
@@ -145,31 +145,6 @@ public class AttributeLayout implements 
         this.isDefault = isDefault;
     }
 
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        final AttributeLayout other = (AttributeLayout) obj;
-        if (layout == null) {
-            if (other.layout != null)
-                return false;
-        } else if (!layout.equals(other.layout))
-            return false;
-        if (index != other.index)
-            return false;
-        if (context != other.context)
-            return false;
-        if (name == null) {
-            if (other.name != null)
-                return false;
-        } else if (!name.equals(other.name))
-            return false;
-        return true;
-    }
-
     public Codec getCodec() {
         if (layout.indexOf('O') >= 0) {
             return Codec.BRANCH5;
@@ -226,22 +201,6 @@ public class AttributeLayout implements 
         return r;
     }
 
-    public boolean isClass() {
-        return context == CONTEXT_CLASS;
-    }
-
-    public boolean isCode() {
-        return context == CONTEXT_CODE;
-    }
-
-    public boolean isField() {
-        return context == CONTEXT_FIELD;
-    }
-
-    public boolean isMethod() {
-        return context == CONTEXT_METHOD;
-    }
-
     /*
      * (non-Javadoc)
      *

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/BcBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/BcBands.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/BcBands.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/BcBands.java Tue Sep 21 19:45:57 2010
@@ -586,21 +586,4 @@ public class BcBands extends BandSet {
     public int[] getBcThisMethod() {
         return bcThisMethod;
     }
-
-    public int[] getBcEscRef() {
-        return bcEscRef;
-    }
-
-    public int[] getBcEscRefSize() {
-        return bcEscRefSize;
-    }
-
-    public int[] getBcEscSize() {
-        return bcEscSize;
-    }
-
-    public int[][] getBcEscByte() {
-        return bcEscByte;
-    }
-
 }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.java Tue Sep 21 19:45:57 2010
@@ -1037,6 +1037,8 @@ public class ClassBands extends BandSet 
                 mbg[i].name_RU = parseCPUTF8References(contextName
                         + "_" + rxa + "_name_RU", in, Codec.UNSIGNED5,
                         pairCount);
+            } else {
+                pairCount = RxACount[i];
             }
             mbg[i].T = decodeBandInt(contextName + "_" + rxa + "_T", in,
                     Codec.BYTE1, pairCount + backwardsCallCounts[i]);
@@ -1085,7 +1087,7 @@ public class ClassBands extends BandSet 
                     + "_caseF_KF", in, Codec.UNSIGNED5, FCount);
             mbg[i].caseJ_KJ = parseCPLongReferences(contextName + "_" + rxa
                     + "_caseJ_KJ", in, Codec.UNSIGNED5, JCount);
-            mbg[i].casec_RS = parseCPUTF8References(contextName + "_" + rxa
+            mbg[i].casec_RS = parseCPSignatureReferences(contextName + "_" + rxa
                     + "_casec_RS", in, Codec.UNSIGNED5, cCount);
             mbg[i].caseet_RS = parseReferences(contextName + "_" + rxa
                     + "_caseet_RS", in, Codec.UNSIGNED5, eCount, cpBands
@@ -1116,17 +1118,7 @@ public class ClassBands extends BandSet 
         int backwardsCallsUsed = 0;
         String[] RxA = new String[] { "RVA", "RIA", "RVPA", "RIPA", "AD" };
         int[] rxaCounts = new int[] { 0, 0, 0, 0, 0 };
-        int[] backwardsCalls = new int[5];
-        int methodAttrIndex = 0;
-        for (int i = 0; i < backwardsCalls.length; i++) {
-            if (rxaCounts[i] > 0) {
-                backwardsCallsUsed++;
-                backwardsCalls[i] = methodAttrCalls[methodAttrIndex];
-                methodAttrIndex++;
-            } else {
-                backwardsCalls[i] = 0;
-            }
-        }
+        
         AttributeLayout rvaLayout = attrMap.getAttributeLayout(
                 AttributeLayout.ATTRIBUTE_RUNTIME_VISIBLE_ANNOTATIONS,
                 AttributeLayout.CONTEXT_METHOD);
@@ -1151,6 +1143,17 @@ public class ClassBands extends BandSet 
             rxaCounts[i] = SegmentUtils
                     .countMatches(methodFlags, rxaLayouts[i]);
         }
+        int[] backwardsCalls = new int[5];
+        int methodAttrIndex = 0;
+        for (int i = 0; i < backwardsCalls.length; i++) {
+            if (rxaCounts[i] > 0) {
+                backwardsCallsUsed++;
+                backwardsCalls[i] = methodAttrCalls[methodAttrIndex];
+                methodAttrIndex++;
+            } else {
+                backwardsCalls[i] = 0;
+            }
+        }
         MetadataBandGroup[] mbgs = parseMetadata(in, RxA, rxaCounts,
                 backwardsCalls, "method");
         List[] attributeLists = new List[RxA.length];

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/CpBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/CpBands.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/CpBands.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/CpBands.java Tue Sep 21 19:45:57 2010
@@ -88,7 +88,7 @@ public class CpBands extends BandSet {
     private Map mapUTF8;
 
 // TODO: Not used
-//    private Map mapSignature;
+    private Map mapSignature;
 
     private int intOffset;
     private int floatOffset;
@@ -341,6 +341,7 @@ public class CpBands extends BandSet {
                 Codec.DELTA5, cpSignatureCount);
         String[] cpSignatureForm = getReferences(cpSignatureInts, cpUTF8);
         cpSignature = new String[cpSignatureCount];
+        mapSignature = new HashMap();
         int lCount = 0;
         for (int i = 0; i < cpSignatureCount; i++) {
             String form = cpSignatureForm[i];
@@ -371,6 +372,7 @@ public class CpBands extends BandSet {
                 }
             }
             cpSignature[i] = signature.toString();
+            mapSignature.put(signature.toString(), new Integer(i));
         }
 //        for (int i = 0; i < cpSignatureInts.length; i++) {
 //            if(cpSignatureInts[i] == -1) {
@@ -475,30 +477,14 @@ public class CpBands extends BandSet {
         return cpDescriptor;
     }
 
-    public double[] getCpDouble() {
-        return cpDouble;
-    }
-
     public String[] getCpFieldClass() {
         return cpFieldClass;
     }
 
-    public String[] getCpFieldDescriptor() {
-        return cpFieldDescriptor;
-    }
-
-    public float[] getCpFloat() {
-        return cpFloat;
-    }
-
     public String[] getCpIMethodClass() {
         return cpIMethodClass;
     }
 
-    public String[] getCpIMethodDescriptor() {
-        return cpIMethodDescriptor;
-    }
-
     public int[] getCpInt() {
         return cpInt;
     }
@@ -519,10 +505,6 @@ public class CpBands extends BandSet {
         return cpSignature;
     }
 
-    public String[] getCpString() {
-        return cpString;
-    }
-
     public String[] getCpUTF8() {
         return cpUTF8;
     }
@@ -547,19 +529,18 @@ public class CpBands extends BandSet {
         CPUTF8 cputf8 = (CPUTF8) stringsToCPUTF8.get(string);
         if (cputf8 == null) {
         	Integer index = null;
-            if(searchForIndex) {
+        	if(searchForIndex) {
             	index = (Integer)mapUTF8.get(string);
             }
             if(index != null) {
             	return cpUTF8Value(index.intValue());
             }
-            /* TODO: mapSignature is not filled anywhere
             if(searchForIndex) {
                 index = (Integer)mapSignature.get(string);
             }
             if(index != null) {
             	return cpSignatureValue(index.intValue());
-            }*/
+            }
             cputf8 = new CPUTF8(string, -1);
             stringsToCPUTF8.put(string, cputf8);
         }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/IcTuple.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/IcTuple.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/IcTuple.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/IcTuple.java Tue Sep 21 19:45:57 2010
@@ -61,10 +61,6 @@ public class IcTuple {
         initializeClassStrings();
     }
 
-    public IcTuple(String C, int F, int cIndex) {
-        this(C, F, null, null, cIndex, -1, -1, -1);
-    }
-
     public static final int NESTED_CLASS_FLAG = 0x00010000;
     protected String C; // this class
     protected int F; // flags
@@ -344,14 +340,6 @@ public class IcTuple {
     	return tIndex;
     }
 
-    public String realOuterClassString() {
-        int firstDollarPosition = cachedOuterClassString.indexOf('$');
-        if (firstDollarPosition <= 0) {
-            return cachedOuterClassString;
-        }
-        return cachedOuterClassString.substring(0, firstDollarPosition);
-    }
-
     public int thisClassIndex() {
         if(predicted()) {
             return cIndex;

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/MetadataBandGroup.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/MetadataBandGroup.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/MetadataBandGroup.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/MetadataBandGroup.java Tue Sep 21 19:45:57 2010
@@ -152,11 +152,11 @@ public class MetadataBandGroup {
                         attributes.add(getParameterAttribute(param_NB[i],
                                 name_RU_Iterator));
                     }
-                } else { // type.equals("AD")
-                    for (int i = 0; i < T.length; i++) {
-                        attributes.add(new AnnotationDefaultAttribute(
-                                new ElementValue(T[i], getNextValue(T[i]))));
-                    }
+                }
+            } else if(type.equals("AD")){
+                for (int i = 0; i < T.length; i++) {
+                    attributes.add(new AnnotationDefaultAttribute(
+                            new ElementValue(T[i], getNextValue(T[i]))));
                 }
             }
         }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java Tue Sep 21 19:45:57 2010
@@ -20,6 +20,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.StringReader;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
@@ -49,7 +50,7 @@ public class NewAttributeBands extends B
 
     private int backwardsCallCount;
 
-    private List attributeLayoutElements;
+    protected List attributeLayoutElements;
 
     public NewAttributeBands(Segment segment, AttributeLayout attributeLayout)
             throws IOException {
@@ -76,14 +77,15 @@ public class NewAttributeBands extends B
      */
     public List parseAttributes(InputStream in, int occurrenceCount)
             throws IOException, Pack200Exception {
-        for(int i = 0; i < attributeLayoutElements.size(); i++) {
-            AttributeLayoutElement element = (AttributeLayoutElement) attributeLayoutElements.get(i);
+        for (int i = 0; i < attributeLayoutElements.size(); i++) {
+            AttributeLayoutElement element = (AttributeLayoutElement) attributeLayoutElements
+                    .get(i);
             element.readBands(in, occurrenceCount);
         }
 
         List attributes = new ArrayList(occurrenceCount);
         for (int i = 0; i < occurrenceCount; i++) {
-        	attributes.add(getOneAttribute(i, attributeLayoutElements));
+            attributes.add(getOneAttribute(i, attributeLayoutElements));
         }
         return attributes;
     }
@@ -100,8 +102,9 @@ public class NewAttributeBands extends B
         NewAttribute attribute = new NewAttribute(segment.getCpBands()
                 .cpUTF8Value(attributeLayout.getName()),
                 attributeLayout.getIndex());
-        for(int i = 0; i < elements.size(); i++) {
-            AttributeLayoutElement element = (AttributeLayoutElement) elements.get(i);
+        for (int i = 0; i < elements.size(); i++) {
+            AttributeLayoutElement element = (AttributeLayoutElement) elements
+                    .get(i);
             element.addToAttribute(index, attribute);
         }
         return attribute;
@@ -135,66 +138,67 @@ public class NewAttributeBands extends B
                     .get(i);
             if (element instanceof Callable) {
                 Callable callable = (Callable) element;
-                if(i == 0) {
-                	callable.setFirstCallable(true);
+                if (i == 0) {
+                    callable.setFirstCallable(true);
                 }
                 List body = callable.body; // Look for calls in the body
-                for(int iIndex = 0; iIndex < body.size(); iIndex++) {
+                for (int iIndex = 0; iIndex < body.size(); iIndex++) {
                     LayoutElement layoutElement = (LayoutElement) body
-							.get(iIndex);
-					// Set the callable for each call
-					backwardsCalls += resolveCallsForElement(i, callable,
-							layoutElement);
+                            .get(iIndex);
+                    // Set the callable for each call
+                    backwardsCalls += resolveCallsForElement(i, callable,
+                            layoutElement);
                 }
             }
         }
         backwardsCallCount = backwardsCalls;
     }
 
-	private int resolveCallsForElement(int i,
-			Callable currentCallable, LayoutElement layoutElement) {
-		int backwardsCalls = 0;
-		if (layoutElement instanceof Call) {
+    private int resolveCallsForElement(int i, Callable currentCallable,
+            LayoutElement layoutElement) {
+        int backwardsCalls = 0;
+        if (layoutElement instanceof Call) {
             Call call = (Call) layoutElement;
-			int index = call.callableIndex;
-			if (index == 0) { // Calls the parent callable
-			    backwardsCalls++;
-			    call.setCallable(currentCallable);
-			} else if (index > 0) { // Forwards call
-			    for (int k = i + 1; k < attributeLayoutElements.size(); k++) {
-			        AttributeLayoutElement el = (AttributeLayoutElement) attributeLayoutElements
-			                .get(k);
-			        if (el instanceof Callable) {
-			            index--;
-			            if (index == 0) {
-			                call.setCallable((Callable) el);
-			                break;
-			            }
-			        }
-			    }
-			} else { // Backwards call
-			    backwardsCalls++;
-			    for (int k = i; k >= 0; k--) {
-			        AttributeLayoutElement el = (AttributeLayoutElement) attributeLayoutElements
-			                .get(k);
-			        if (el instanceof Callable) {
-			            index++;
-			            if (index == 0) {
-			                call.setCallable((Callable) el);
-			                break;
-			            }
-			        }
-			    }
-			}
-		} else if (layoutElement instanceof Replication) {
-			List children = ((Replication)layoutElement).layoutElements;
-			for (Iterator iterator = children.iterator(); iterator.hasNext();) {
-				LayoutElement object = (LayoutElement) iterator.next();
-				backwardsCalls += resolveCallsForElement(i, currentCallable, object);
-			}
-		}
-		return backwardsCalls;
-	}
+            int index = call.callableIndex;
+            if (index == 0) { // Calls the parent callable
+                backwardsCalls++;
+                call.setCallable(currentCallable);
+            } else if (index > 0) { // Forwards call
+                for (int k = i + 1; k < attributeLayoutElements.size(); k++) {
+                    AttributeLayoutElement el = (AttributeLayoutElement) attributeLayoutElements
+                            .get(k);
+                    if (el instanceof Callable) {
+                        index--;
+                        if (index == 0) {
+                            call.setCallable((Callable) el);
+                            break;
+                        }
+                    }
+                }
+            } else { // Backwards call
+                backwardsCalls++;
+                for (int k = i - 1; k >= 0; k--) {
+                    AttributeLayoutElement el = (AttributeLayoutElement) attributeLayoutElements
+                            .get(k);
+                    if (el instanceof Callable) {
+                        index++;
+                        if (index == 0) {
+                            call.setCallable((Callable) el);
+                            break;
+                        }
+                    }
+                }
+            }
+        } else if (layoutElement instanceof Replication) {
+            List children = ((Replication) layoutElement).layoutElements;
+            for (Iterator iterator = children.iterator(); iterator.hasNext();) {
+                LayoutElement object = (LayoutElement) iterator.next();
+                backwardsCalls += resolveCallsForElement(i, currentCallable,
+                        object);
+            }
+        }
+        return backwardsCalls;
+    }
 
     private AttributeLayoutElement readNextAttributeElement(StringReader stream)
             throws IOException {
@@ -224,10 +228,10 @@ public class NewAttributeBands extends B
         case 'H':
         case 'I':
         case 'V':
-            return new Integral(new String(new char[] { (char)nextChar }));
+            return new Integral(new String(new char[] { (char) nextChar }));
         case 'S':
         case 'F':
-            return new Integral(new String(new char[] { (char)nextChar,
+            return new Integral(new String(new char[] { (char) nextChar,
                     (char) stream.read() }));
         case 'P':
             stream.mark(1);
@@ -284,7 +288,7 @@ public class NewAttributeBands extends B
             // Reference
         case 'K':
         case 'R':
-            String string = "" + (char)nextChar + (char) stream.read();
+            String string = "" + (char) nextChar + (char) stream.read();
             char nxt = (char) stream.read();
             string += nxt;
             if (nxt == 'N') {
@@ -316,9 +320,9 @@ public class NewAttributeBands extends B
         List tags = new ArrayList();
         Integer nextTag;
         do {
-        	nextTag = readNumber(stream);
-            if(nextTag != null) {
-            	tags.add(nextTag);
+            nextTag = readNumber(stream);
+            if (nextTag != null) {
+                tags.add(nextTag);
                 stream.read(); // ',' or ')'
             }
         } while (nextTag != null);
@@ -385,9 +389,10 @@ public class NewAttributeBands extends B
         }
     }
 
-    private class Integral extends LayoutElement {
+    public class Integral extends LayoutElement {
 
         private final String tag;
+
         private int[] band;
 
         public Integral(String tag) {
@@ -447,12 +452,16 @@ public class NewAttributeBands extends B
             return band[index];
         }
 
+        public String getTag() {
+            return tag;
+        }
+
     }
 
     /**
      * A replication is an array of layout elements, with an associated count
      */
-    private class Replication extends LayoutElement {
+    public class Replication extends LayoutElement {
 
         private final Integral countElement;
 
@@ -474,7 +483,7 @@ public class NewAttributeBands extends B
             for (int i = 0; i < count; i++) {
                 arrayCount += countElement.getValue(i);
             }
-            for(int i = 0; i < layoutElements.size(); i++) {
+            for (int i = 0; i < layoutElements.size(); i++) {
                 LayoutElement element = (LayoutElement) layoutElements.get(i);
                 element.readBands(in, arrayCount);
             }
@@ -492,18 +501,27 @@ public class NewAttributeBands extends B
             long numElements = countElement.getValue(index);
             for (int i = offset; i < offset + numElements; i++) {
                 for (int it = 0; it < layoutElements.size(); it++) {
-                    LayoutElement element = (LayoutElement) layoutElements.get(it);
+                    LayoutElement element = (LayoutElement) layoutElements
+                            .get(it);
                     element.addToAttribute(i, attribute);
                 }
             }
         }
+
+        public Integral getCountElement() {
+            return countElement;
+        }
+
+        public List getLayoutElements() {
+            return layoutElements;
+        }
     }
 
     /**
      * A Union is a type of layout element where the tag value acts as a
      * selector for one of the union cases
      */
-    private class Union extends LayoutElement {
+    public class Union extends LayoutElement {
 
         private final Integral unionTag;
         private final List unionCases;
@@ -535,7 +553,7 @@ public class NewAttributeBands extends B
             // Count number of default cases then read the default bands
             for (int i = 0; i < values.length; i++) {
                 boolean found = false;
-                for(int it = 0; it < unionCases.size(); it++) {
+                for (int it = 0; it < unionCases.size(); it++) {
                     UnionCase unionCase = (UnionCase) unionCases.get(it);
                     if (unionCase.hasTag(values[i])) {
                         found = true;
@@ -546,8 +564,9 @@ public class NewAttributeBands extends B
                 }
             }
             if (defaultCaseBody != null) {
-                for(int i = 0; i < defaultCaseBody.size(); i++) {
-                    LayoutElement element = (LayoutElement) defaultCaseBody.get(i);
+                for (int i = 0; i < defaultCaseBody.size(); i++) {
+                    LayoutElement element = (LayoutElement) defaultCaseBody
+                            .get(i);
                     element.readBands(in, defaultCount);
                 }
             }
@@ -559,7 +578,7 @@ public class NewAttributeBands extends B
             int[] tagBand = unionTag.band;
             long tag = unionTag.getValue(n);
             boolean defaultCase = true;
-            for(int i = 0; i < unionCases.size(); i++) {
+            for (int i = 0; i < unionCases.size(); i++) {
                 UnionCase element = (UnionCase) unionCases.get(i);
                 if (element.hasTag(tag)) {
                     defaultCase = false;
@@ -576,7 +595,7 @@ public class NewAttributeBands extends B
                 int defaultOffset = 0;
                 for (int j = 0; j < n; j++) {
                     boolean found = false;
-                    for(int i = 0; i < unionCases.size(); i++) {
+                    for (int i = 0; i < unionCases.size(); i++) {
                         UnionCase element = (UnionCase) unionCases.get(i);
                         if (element.hasTag(tagBand[j])) {
                             found = true;
@@ -587,17 +606,30 @@ public class NewAttributeBands extends B
                     }
                 }
                 if (defaultCaseBody != null) {
-                    for(int i = 0; i < defaultCaseBody.size(); i++) {
-                        LayoutElement element = (LayoutElement) defaultCaseBody.get(i);
+                    for (int i = 0; i < defaultCaseBody.size(); i++) {
+                        LayoutElement element = (LayoutElement) defaultCaseBody
+                                .get(i);
                         element.addToAttribute(defaultOffset, attribute);
                     }
                 }
             }
         }
 
+        public Integral getUnionTag() {
+            return unionTag;
+        }
+
+        public List getUnionCases() {
+            return unionCases;
+        }
+
+        public List getDefaultCaseBody() {
+            return defaultCaseBody;
+        }
+
     }
 
-    private class Call extends LayoutElement {
+    public class Call extends LayoutElement {
 
         private final int callableIndex;
         private Callable callable;
@@ -628,12 +660,20 @@ public class NewAttributeBands extends B
         public void addToAttribute(int n, NewAttribute attribute) {
             callable.addNextToAttribute(attribute);
         }
+
+        public int getCallableIndex() {
+            return callableIndex;
+        }
+
+        public Callable getCallable() {
+            return callable;
+        }
     }
 
     /**
      * Constant Pool Reference
      */
-    private class Reference extends LayoutElement {
+    public class Reference extends LayoutElement {
 
         private final String tag;
 
@@ -679,8 +719,8 @@ public class NewAttributeBands extends B
                 band = parseCPMethodRefReferences(attributeLayout.getName(),
                         in, Codec.UNSIGNED5, count);
             } else if (tag.startsWith("RI")) { // Interface Method Reference
-                band = parseCPInterfaceMethodRefReferences(attributeLayout
-                        .getName(), in, Codec.UNSIGNED5, count);
+                band = parseCPInterfaceMethodRefReferences(
+                        attributeLayout.getName(), in, Codec.UNSIGNED5, count);
             } else if (tag.startsWith("RU")) { // UTF8 String
                 band = parseCPUTF8References(attributeLayout.getName(), in,
                         Codec.UNSIGNED5, count);
@@ -689,42 +729,46 @@ public class NewAttributeBands extends B
 
         public void addToAttribute(int n, NewAttribute attribute) {
             if (tag.startsWith("KI")) { // Integer
-                attribute.addCPConstant(length, ((CPInteger[]) band)[n]);
+                attribute.addToBody(length, ((CPInteger[]) band)[n]);
             } else if (tag.startsWith("KJ")) { // Long
-                attribute.addCPConstant(length, ((CPLong[]) band)[n]);
+                attribute.addToBody(length, ((CPLong[]) band)[n]);
             } else if (tag.startsWith("KF")) { // Float
-                attribute.addCPConstant(length, ((CPFloat[]) band)[n]);
+                attribute.addToBody(length, ((CPFloat[]) band)[n]);
             } else if (tag.startsWith("KD")) { // Double
-                attribute.addCPConstant(length, ((CPDouble[]) band)[n]);
+                attribute.addToBody(length, ((CPDouble[]) band)[n]);
             } else if (tag.startsWith("KS")) { // String
-                attribute.addCPConstant(length, ((CPString[]) band)[n]);
+                attribute.addToBody(length, ((CPString[]) band)[n]);
             } else if (tag.startsWith("RC")) { // Class
-                attribute.addCPClass(length, ((CPClass[]) band)[n]);
+                attribute.addToBody(length, ((CPClass[]) band)[n]);
             } else if (tag.startsWith("RS")) { // Signature
-                attribute.addCPUTF8(length, ((CPUTF8[]) band)[n]);
+                attribute.addToBody(length, ((CPUTF8[]) band)[n]);
             } else if (tag.startsWith("RD")) { // Descriptor
-                attribute.addCPNameAndType(length, ((CPNameAndType[]) band)[n]);
+                attribute.addToBody(length, ((CPNameAndType[]) band)[n]);
             } else if (tag.startsWith("RF")) { // Field Reference
-                attribute.addCPFieldRef(length, ((CPFieldRef[]) band)[n]);
+                attribute.addToBody(length, ((CPFieldRef[]) band)[n]);
             } else if (tag.startsWith("RM")) { // Method Reference
-                attribute.addCPMethodRef(length, ((CPMethodRef[]) band)[n]);
+                attribute.addToBody(length, ((CPMethodRef[]) band)[n]);
             } else if (tag.startsWith("RI")) { // Interface Method Reference
-                attribute.addCPIMethodRef(length,
+                attribute.addToBody(length,
                         ((CPInterfaceMethodRef[]) band)[n]);
             } else if (tag.startsWith("RU")) { // UTF8 String
-                attribute.addCPUTF8(length, ((CPUTF8[]) band)[n]);
+                attribute.addToBody(length, ((CPUTF8[]) band)[n]);
             }
         }
 
+        public String getTag() {
+            return tag;
+        }
+
     }
 
-    private static class Callable implements AttributeLayoutElement {
+    public static class Callable implements AttributeLayoutElement {
 
         private final List body;
 
         private boolean isBackwardsCallable;
 
-		private boolean isFirstCallable;
+        private boolean isFirstCallable;
 
         public Callable(List body) throws IOException {
             this.body = body;
@@ -740,7 +784,7 @@ public class NewAttributeBands extends B
          * @param attribute
          */
         public void addNextToAttribute(NewAttribute attribute) {
-            for(int i = 0; i < body.size(); i++) {
+            for (int i = 0; i < body.size(); i++) {
                 LayoutElement element = (LayoutElement) body.get(i);
                 element.addToAttribute(index, attribute);
             }
@@ -758,26 +802,26 @@ public class NewAttributeBands extends B
 
         public void readBands(InputStream in, int count) throws IOException,
                 Pack200Exception {
-        	if(isFirstCallable) {
-        		count += this.count;
-        	} else {
-        		count = this.count;
-        	}
-            for(int i = 0; i < body.size(); i++) {
+            if (isFirstCallable) {
+                count += this.count;
+            } else {
+                count = this.count;
+            }
+            for (int i = 0; i < body.size(); i++) {
                 LayoutElement element = (LayoutElement) body.get(i);
                 element.readBands(in, count);
             }
         }
 
         public void addToAttribute(int n, NewAttribute attribute) {
-        	if(isFirstCallable) {
-	            // Ignore n because bands also contain element parts from calls
-	            for(int i = 0; i < body.size(); i++) {
-	                LayoutElement element = (LayoutElement) body.get(i);
-	                element.addToAttribute(index, attribute);
-	            }
-	            index++;
-        	}
+            if (isFirstCallable) {
+                // Ignore n because bands also contain element parts from calls
+                for (int i = 0; i < body.size(); i++) {
+                    LayoutElement element = (LayoutElement) body.get(i);
+                    element.addToAttribute(index, attribute);
+                }
+                index++;
+            }
         }
 
         public boolean isBackwardsCallable() {
@@ -791,15 +835,19 @@ public class NewAttributeBands extends B
             this.isBackwardsCallable = true;
         }
 
-		public void setFirstCallable(boolean isFirstCallable) {
-			this.isFirstCallable = isFirstCallable;
-		}
+        public void setFirstCallable(boolean isFirstCallable) {
+            this.isFirstCallable = isFirstCallable;
+        }
+
+        public List getBody() {
+            return body;
+        }
     }
 
     /**
      * A Union case
      */
-    private class UnionCase extends LayoutElement {
+    public class UnionCase extends LayoutElement {
 
         private List body;
 
@@ -821,7 +869,7 @@ public class NewAttributeBands extends B
         public void readBands(InputStream in, int count) throws IOException,
                 Pack200Exception {
             if (body != null) {
-                for(int i = 0; i < body.size(); i++) {
+                for (int i = 0; i < body.size(); i++) {
                     LayoutElement element = (LayoutElement) body.get(i);
                     element.readBands(in, count);
                 }
@@ -830,12 +878,16 @@ public class NewAttributeBands extends B
 
         public void addToAttribute(int index, NewAttribute attribute) {
             if (body != null) {
-                for(int i = 0; i < body.size(); i++) {
+                for (int i = 0; i < body.size(); i++) {
                     LayoutElement element = (LayoutElement) body.get(i);
                     element.addToAttribute(index, attribute);
                 }
             }
         }
+
+        public List getBody() {
+            return body == null ? Collections.EMPTY_LIST : body;
+        }
     }
 
     /**
@@ -876,7 +928,8 @@ public class NewAttributeBands extends B
             return Codec.BRANCH5;
         } else if (layoutElement.indexOf('P') >= 0) {
             return Codec.BCI5;
-        } else if (layoutElement.indexOf('S') >= 0 && layoutElement.indexOf("KS") < 0 //$NON-NLS-1$
+        } else if (layoutElement.indexOf('S') >= 0
+                && layoutElement.indexOf("KS") < 0 //$NON-NLS-1$
                 && layoutElement.indexOf("RS") < 0) { //$NON-NLS-1$
             return Codec.SIGNED5;
         } else if (layoutElement.indexOf('B') >= 0) {
@@ -934,15 +987,16 @@ public class NewAttributeBands extends B
             length++;
         }
         stream.reset();
-        if(length == 0) {
-        	return null;
+        if (length == 0) {
+            return null;
         }
         char[] digits = new char[length];
         int read = stream.read(digits);
         if (read != digits.length) {
             throw new IOException("Error reading from the input stream");
         }
-        return new Integer(Integer.parseInt((negative ? "-" : "") + new String(digits)));
+        return new Integer(Integer.parseInt((negative ? "-" : "")
+                + new String(digits)));
     }
 
     /**
@@ -978,8 +1032,9 @@ public class NewAttributeBands extends B
     public void setBackwardsCalls(int[] backwardsCalls) throws IOException {
         int index = 0;
         parseLayout();
-        for(int i = 0; i < attributeLayoutElements.size(); i++) {
-            AttributeLayoutElement element = (AttributeLayoutElement) attributeLayoutElements.get(i);
+        for (int i = 0; i < attributeLayoutElements.size(); i++) {
+            AttributeLayoutElement element = (AttributeLayoutElement) attributeLayoutElements
+                    .get(i);
             if (element instanceof Callable
                     && ((Callable) element).isBackwardsCallable()) {
                 ((Callable) element).addCount(backwardsCalls[index]);

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/Segment.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/Segment.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/Segment.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/Segment.java Tue Sep 21 19:45:57 2010
@@ -150,7 +150,12 @@ public class Segment {
                             AttributeLayout.ATTRIBUTE_SOURCE_FILE,
                             AttributeLayout.CONTEXT_CLASS);
             if (SOURCE_FILE.matches(classBands.getRawClassFlags()[classNum])) {
-                int firstDollar = SegmentUtils.indexOfFirstDollar(fullName);
+                int firstDollar = -1;
+                for (int index = 0; index < fullName.length(); index++) {
+                    if (fullName.charAt(index) <= '$') {
+                        firstDollar = index;
+                    }
+                }
                 String fileName = null;
 
                 if (firstDollar > -1 && (i <= firstDollar)) {
@@ -225,7 +230,6 @@ public class Segment {
         // methodDescr and methodFlags used to create this
         for (i = 0; i < cfMethods.length; i++) {
             int descriptorIndex = classBands.getMethodDescrInts()[classNum][i];
-//            int colon = descriptorStr.indexOf(':');
             int nameIndex = cpBands.getCpDescriptorNameInts()[descriptorIndex];
             int typeIndex = cpBands.getCpDescriptorTypeInts()[descriptorIndex];
             CPUTF8 name = cpBands.cpUTF8Value(nameIndex);
@@ -506,6 +510,9 @@ public class Segment {
 
     void unpackWrite(JarOutputStream out) throws IOException, Pack200Exception {
         writeJar(out);
+        if(logStream != null) {
+            logStream.close();
+        }
     }
 
     /**
@@ -592,10 +599,6 @@ public class Segment {
         return attrDefinitionBands;
     }
 
-    protected BcBands getBcBands() {
-        return bcBands;
-    }
-
     protected ClassBands getClassBands() {
         return classBands;
     }
@@ -604,10 +607,6 @@ public class Segment {
         return cpBands;
     }
 
-    protected FileBands getFileBands() {
-        return fileBands;
-    }
-
     protected IcBands getIcBands() {
         return icBands;
     }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/SegmentHeader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/SegmentHeader.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/SegmentHeader.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/SegmentHeader.java Tue Sep 21 19:45:57 2010
@@ -165,14 +165,6 @@ public class SegmentHeader {
         return archiveModtime;
     }
 
-    public int getArchiveMajor() {
-        return archiveMajor;
-    }
-
-    public int getArchiveMinor() {
-        return archiveMinor;
-    }
-
     public int getAttributeDefinitionCount() {
         return attributeDefinitionCount;
     }
@@ -241,10 +233,6 @@ public class SegmentHeader {
         return innerClassCount;
     }
 
-    public void setNumberOfFiles(int numberOfFiles) {
-        this.numberOfFiles = numberOfFiles;
-    }
-
     public long getArchiveSize() {
         return archiveSize;
     }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/SegmentUtils.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/SegmentUtils.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/SegmentUtils.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/SegmentUtils.java Tue Sep 21 19:45:57 2010
@@ -124,41 +124,4 @@ public final class SegmentUtils {
         return count;
     }
 
-    /**
-     * Answer the index of the first character <= '$' in the parameter. This is
-     * used instead of indexOf('$') because inner classes may be separated by
-     * any character <= '$' (in other words, Foo#Bar is as valid as Foo$Bar). If
-     * no $ character is found, answer -1.
-     *
-     * @param string
-     *            String to search for $
-     * @return first index of $ character, or -1 if not found
-     */
-    public static int indexOfFirstDollar(String string) {
-        for (int index = 0; index < string.length(); index++) {
-            if (string.charAt(index) <= '$') {
-                return index;
-            }
-        }
-        return -1;
-    }
-
-    private SegmentUtils() {
-        // Intended to be a helper class
-    }
-
-    /**
-     * This is a debugging message to aid the developer in writing this class.
-     * If the property 'debug.unpack200' is set, this will generate messages to
-     * stderr; otherwise, it will be silent.
-     *
-     * @param message
-     * @deprecated this may be removed from production code
-     */
-    public static void debug(String message) {
-        if (System.getProperty("debug.unpack200") != null) {
-            System.err.println(message);
-        }
-    }
-
 }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/AnnotationsAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/AnnotationsAttribute.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/AnnotationsAttribute.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/AnnotationsAttribute.java Tue Sep 21 19:45:57 2010
@@ -127,6 +127,9 @@ public abstract class AnnotationsAttribu
             } else if (value instanceof CPClass) {
                 ((CPClass) value).resolve(pool);
                 constant_value_index = pool.indexOf((CPClass) value);
+            } else if (value instanceof CPUTF8) {
+                ((CPUTF8) value).resolve(pool);
+                constant_value_index = pool.indexOf((CPUTF8) value);
             } else if (value instanceof CPNameAndType) {
                 ((CPNameAndType) value).resolve(pool);
             } else if (value instanceof Annotation) {
@@ -149,9 +152,12 @@ public abstract class AnnotationsAttribu
                 ((Annotation) value).writeBody(dos);
             } else if (value instanceof ElementValue[]) {
                 ElementValue[] nestedValues = (ElementValue[]) value;
+                dos.writeShort(nestedValues.length);
                 for (int i = 0; i < nestedValues.length; i++) {
                     nestedValues[i].writeBody(dos);
                 }
+            } else {
+                throw new Error("");
             }
         }
 
@@ -166,6 +172,7 @@ public abstract class AnnotationsAttribu
             case 'S':
             case 'Z':
             case 'c':
+            case 's':
                 return 3;
             case 'e':
                 return 5;

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ByteCode.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ByteCode.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ByteCode.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ByteCode.java Tue Sep 21 19:45:57 2010
@@ -100,17 +100,8 @@ public class ByteCode extends ClassFileE
         return getByteCodeForm().getOpcode();
     }
 
-    private boolean hashcodeComputed;
-    private int cachedHashCode;
-
-    private void generateHashCode() {
-        cachedHashCode = objectHashCode();
-    }
-
     public int hashCode() {
-        if (!hashcodeComputed)
-            generateHashCode();
-        return cachedHashCode;
+        return objectHashCode();
     }
 
     /*

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPRef.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPRef.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPRef.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CPRef.java Tue Sep 21 19:45:57 2010
@@ -76,11 +76,6 @@ public abstract class CPRef extends Cons
         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);

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassConstantPool.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassConstantPool.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassConstantPool.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassConstantPool.java Tue Sep 21 19:45:57 2010
@@ -39,10 +39,6 @@ public class ClassConstantPool {
 
     protected Map indexCache;
 
-    public String toString() {
-        return entries.toString();
-    }
-
     private final List others = new ArrayList(500);
     private final List entries = new ArrayList(500);
 
@@ -115,8 +111,6 @@ public class ClassConstantPool {
             // children now become parents
             parents.clear();
             parents.addAll(children);
-
-
         }
     }
 

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassFileEntry.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassFileEntry.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassFileEntry.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassFileEntry.java Tue Sep 21 19:45:57 2010
@@ -46,10 +46,6 @@ public abstract class ClassFileEntry {
         resolved = true;
     }
 
-    protected boolean isResolved() {
-        return resolved;
-    }
-
     protected int objectHashCode() {
         return super.hashCode();
     }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CodeAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CodeAttribute.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CodeAttribute.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/CodeAttribute.java Tue Sep 21 19:45:57 2010
@@ -173,14 +173,6 @@ public class CodeAttribute extends BCIRe
         }
     }
 
-    public List attributes() {
-        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/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/DeprecatedAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/DeprecatedAttribute.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/DeprecatedAttribute.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/DeprecatedAttribute.java Tue Sep 21 19:45:57 2010
@@ -61,8 +61,4 @@ public class DeprecatedAttribute extends
         return "Deprecated Attribute";
     }
 
-    public boolean equals(Object obj) {
-        return this == obj;
-    }
-
 }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/EnclosingMethodAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/EnclosingMethodAttribute.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/EnclosingMethodAttribute.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/EnclosingMethodAttribute.java Tue Sep 21 19:45:57 2010
@@ -88,8 +88,4 @@ public class EnclosingMethodAttribute ex
         return "EnclosingMethod";
     }
 
-    public boolean equals(Object obj) {
-        return this == obj;
-    }
-
 }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LocalVariableTableAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LocalVariableTableAttribute.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LocalVariableTableAttribute.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LocalVariableTableAttribute.java Tue Sep 21 19:45:57 2010
@@ -28,7 +28,7 @@ import org.apache.harmony.pack200.Pack20
  */
 public class LocalVariableTableAttribute extends BCIRenumberedAttribute {
 
-    private int local_variable_table_length;
+    private final int local_variable_table_length;
     private final int[] start_pcs;
     private final int[] lengths;
     private int[] name_indexes;
@@ -164,8 +164,4 @@ public class LocalVariableTableAttribute
             lengths[index] = revisedLength;
         }
     }
-
-    public boolean equals(Object obj) {
-        return this == obj;
-    }
 }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LocalVariableTypeTableAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LocalVariableTypeTableAttribute.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LocalVariableTypeTableAttribute.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/LocalVariableTypeTableAttribute.java Tue Sep 21 19:45:57 2010
@@ -28,7 +28,7 @@ import org.apache.harmony.pack200.Pack20
  */
 public class LocalVariableTypeTableAttribute extends BCIRenumberedAttribute {
 
-    private int local_variable_type_table_length;
+    private final int local_variable_type_table_length;
     private final int[] start_pcs;
     private final int[] lengths;
     private int[] name_indexes;
@@ -165,8 +165,4 @@ public class LocalVariableTypeTableAttri
                 + " varaibles";
     }
 
-    public boolean equals(Object obj) {
-        return this == obj;
-    }
-
 }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/NewAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/NewAttribute.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/NewAttribute.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/NewAttribute.java Tue Sep 21 19:45:57 2010
@@ -113,39 +113,9 @@ public class NewAttribute extends BCIRen
         body.add(new BCLength(value));
     }
 
-    public void addCPConstant(int length, CPConstant constant) {
+    public void addToBody(int length, Object value) {
         lengths.add(new Integer(length));
-        body.add(constant);
-    }
-
-    public void addCPClass(int length, CPClass class1) {
-        lengths.add(new Integer(length));
-        body.add(class1);
-    }
-
-    public void addCPUTF8(int length, CPUTF8 cputf8) {
-        lengths.add(new Integer(length));
-        body.add(cputf8);
-    }
-
-    public void addCPNameAndType(int length, CPNameAndType type) {
-        lengths.add(new Integer(length));
-        body.add(type);
-    }
-
-    public void addCPFieldRef(int length, CPFieldRef ref) {
-        lengths.add(new Integer(length));
-        body.add(ref);
-    }
-
-    public void addCPMethodRef(int length, CPMethodRef ref) {
-        lengths.add(new Integer(length));
-        body.add(ref);
-    }
-
-    public void addCPIMethodRef(int length, CPInterfaceMethodRef ref) {
-        lengths.add(new Integer(length));
-        body.add(ref);
+        body.add(value);
     }
 
     protected void resolve(ClassConstantPool pool) {

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/OperandManager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/OperandManager.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/OperandManager.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/OperandManager.java Tue Sep 21 19:45:57 2010
@@ -196,10 +196,6 @@ public class OperandManager {
         this.segment = segment;
     }
 
-    public Segment getSegment() {
-        return segment;
-    }
-
     public SegmentConstantPool globalConstantPool() {
         return segment.getConstantPool();
     }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleAnnotationsAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleAnnotationsAttribute.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleAnnotationsAttribute.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleAnnotationsAttribute.java Tue Sep 21 19:45:57 2010
@@ -54,10 +54,14 @@ public class RuntimeVisibleorInvisibleAn
     }
 
     protected void writeBody(DataOutputStream dos) throws IOException {
+        int size = dos.size();
         dos.writeShort(num_annotations);
         for (int i = 0; i < num_annotations; i++) {
             annotations[i].writeBody(dos);
         }
+        if (dos.size() - size != getLength()) {
+            throw new Error();
+        }
     }
 
     public String toString() {
@@ -65,10 +69,6 @@ public class RuntimeVisibleorInvisibleAn
                 + " annotations";
     }
 
-    public boolean equals(Object obj) {
-        return this == obj;
-    }
-
     protected ClassFileEntry[] getNestedClassFileEntries() {
         List nested = new ArrayList();
         nested.add(attributeName);

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java Tue Sep 21 19:45:57 2010
@@ -110,10 +110,6 @@ public class RuntimeVisibleorInvisiblePa
 
     }
 
-    public boolean equals(Object obj) {
-        return this == obj;
-    }
-
     protected ClassFileEntry[] getNestedClassFileEntries() {
         List nested = new ArrayList();
         nested.add(attributeName);

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/SignatureAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/SignatureAttribute.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/SignatureAttribute.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/SignatureAttribute.java Tue Sep 21 19:45:57 2010
@@ -76,8 +76,4 @@ public class SignatureAttribute extends 
         return "Signature: " + signature;
     }
 
-
-    public boolean equals(Object obj) {
-        return this == obj;
-    }
 }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/LocalForm.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/LocalForm.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/LocalForm.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/LocalForm.java Tue Sep 21 19:45:57 2010
@@ -26,10 +26,6 @@ import org.apache.harmony.unpack200.byte
  */
 public class LocalForm extends ByteCodeForm {
 
-    public LocalForm(int opcode, String name) {
-        super(opcode, name);
-    }
-
     public LocalForm(int opcode, String name, int[] rewrite) {
         super(opcode, name, rewrite);
     }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/LookupSwitchForm.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/LookupSwitchForm.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/LookupSwitchForm.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/LookupSwitchForm.java Tue Sep 21 19:45:57 2010
@@ -25,10 +25,6 @@ public class LookupSwitchForm extends Sw
         super(opcode, name);
     }
 
-    public LookupSwitchForm(int opcode, String name, int[] rewrite) {
-        super(opcode, name, rewrite);
-    }
-
     /*
      * (non-Javadoc)
      *

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/SwitchForm.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/SwitchForm.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/SwitchForm.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/SwitchForm.java Tue Sep 21 19:45:57 2010
@@ -18,7 +18,6 @@ package org.apache.harmony.unpack200.byt
 
 import org.apache.harmony.unpack200.bytecode.ByteCode;
 import org.apache.harmony.unpack200.bytecode.CodeAttribute;
-import org.apache.harmony.unpack200.bytecode.OperandManager;
 
 public abstract class SwitchForm extends VariableInstructionForm {
 
@@ -26,21 +25,6 @@ public abstract class SwitchForm extends
         super(opcode, name);
     }
 
-    public SwitchForm(int opcode, String name, int[] rewrite) {
-        super(opcode, name, rewrite);
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see org.apache.harmony.unpack200.bytecode.forms.ByteCodeForm#setByteCodeOperands(org.apache.harmony.unpack200.bytecode.ByteCode,
-     *      org.apache.harmony.unpack200.bytecode.OperandTable,
-     *      org.apache.harmony.unpack200.SegmentConstantPool)
-     */
-    public void setByteCodeOperands(ByteCode byteCode,
-            OperandManager operandManager, int codeLength) {
-    }
-
     /*
      * (non-Javadoc)
      *

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/TableSwitchForm.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/TableSwitchForm.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/TableSwitchForm.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/TableSwitchForm.java Tue Sep 21 19:45:57 2010
@@ -25,10 +25,6 @@ public class TableSwitchForm extends Swi
         super(opcode, name);
     }
 
-    public TableSwitchForm(int opcode, String name, int[] rewrite) {
-        super(opcode, name, rewrite);
-    }
-
     /*
      * (non-Javadoc)
      *

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/VariableInstructionForm.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/VariableInstructionForm.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/VariableInstructionForm.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/VariableInstructionForm.java Tue Sep 21 19:45:57 2010
@@ -27,10 +27,6 @@ public abstract class VariableInstructio
         super(opcode, name);
     }
 
-    public VariableInstructionForm(int opcode, String name, int[] rewrite) {
-        super(opcode, name, rewrite);
-    }
-
     /**
      * Given an int operand, set the rewrite bytes for the next available
      * operand position and the three immediately following it to a
@@ -65,38 +61,6 @@ public abstract class VariableInstructio
     }
 
     /**
-     * Given an int operand, set the rewrite bytes for the next available
-     * operand position and the byte immediately following it to a high-byte,
-     * low-byte encoding of the operand.
-     *
-     * Note that unlike the ByteCode setOperand* operations, this starts with an
-     * actual bytecode rewrite array (rather than a ByteCodeForm prototype
-     * rewrite array). Also, this method overwrites -1 values in the rewrite
-     * array - so if you start with an array that looks like: {100, -1, -1, -1,
-     * -1, 200, -1, -1, -1, -1} then calling setRewrite2Bytes(0, rewrite) the
-     * first time will convert it to: {100, 0, 0, -1, -1, 200, -1, -1, -1, -1}
-     * Calling setRewrite2Bytes(0, rewrite) a second time will convert it to:
-     * {100, 0, 0, 0, 0, 200, -1, -1, -1, -1}
-     *
-     * @param operand
-     *            int to set the rewrite bytes to
-     * @param rewrite
-     *            int[] bytes to rewrite
-     */
-    public void setRewrite2Bytes(int operand, int[] rewrite) {
-        int firstOperandPosition = -1;
-
-        // Find the first -1 in the rewrite array
-        for (int index = 0; index < rewrite.length - 3; index++) {
-            if ((rewrite[index] == -1) && (rewrite[index + 1] == -1)) {
-                firstOperandPosition = index;
-                break;
-            }
-        }
-        setRewrite2Bytes(operand, firstOperandPosition, rewrite);
-    }
-
-    /**
      * This method writes operand directly into the rewrite array at index
      * position specified.
      *

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/WideForm.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/WideForm.java?rev=999573&r1=999572&r2=999573&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/WideForm.java (original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/WideForm.java Tue Sep 21 19:45:57 2010
@@ -30,10 +30,6 @@ public class WideForm extends VariableIn
         super(opcode, name);
     }
 
-    public WideForm(int opcode, String name, int[] rewrite) {
-        super(opcode, name, rewrite);
-    }
-
     /*
      * (non-Javadoc)
      *



Mime
View raw message