harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjanu...@apache.org
Subject svn commit: r999306 - in /harmony/enhanced/java/trunk/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200: NewAttributeBands.java bytecode/NewAttribute.java
Date Tue, 21 Sep 2010 10:47:46 GMT
Author: sjanuary
Date: Tue Sep 21 10:47:46 2010
New Revision: 999306

URL: http://svn.apache.org/viewvc?rev=999306&view=rev
Log:
Pack200 - simplify method calls

Modified:
    harmony/enhanced/java/trunk/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java
    harmony/enhanced/java/trunk/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/NewAttribute.java

Modified: harmony/enhanced/java/trunk/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java?rev=999306&r1=999305&r2=999306&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java
Tue Sep 21 10:47:46 2010
@@ -729,30 +729,30 @@ 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]);
             }
         }
 

Modified: harmony/enhanced/java/trunk/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/NewAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/NewAttribute.java?rev=999306&r1=999305&r2=999306&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/NewAttribute.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/NewAttribute.java
Tue Sep 21 10:47:46 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) {



Mime
View raw message