harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjanu...@apache.org
Subject svn commit: r647100 [5/9] - in /harmony/enhanced/classlib/trunk/modules/pack200/src: main/java/org/apache/harmony/pack200/ main/java/org/apache/harmony/pack200/bytecode/ main/java/org/apache/harmony/pack200/bytecode/forms/ test/java/org/apache/harmony/...
Date Fri, 11 Apr 2008 10:10:00 GMT
Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java Fri Apr 11 03:09:38 2008
@@ -78,8 +78,7 @@
 
     private SegmentOptions options;
 
-	private final Segment segment;
-
+    private final Segment segment;
 
     /**
      * The magic header for a Pack200 Segment is 0xCAFED00D. I wonder where they
@@ -88,11 +87,11 @@
     private static final int[] magic = { 0xCA, 0xFE, 0xD0, 0x0D };
 
     public SegmentHeader(Segment segment) {
-		this.segment = segment;
-	}
+        this.segment = segment;
+    }
 
-    public void unpack(InputStream in) throws IOException,
-            Pack200Exception, Error, Pack200Exception {
+    public void unpack(InputStream in) throws IOException, Pack200Exception,
+            Error, Pack200Exception {
         long word[] = decodeScalar("archive_magic_word", in, Codec.BYTE1,
                 magic.length);
         for (int m = 0; m < magic.length; m++)
@@ -118,7 +117,7 @@
 
     /**
      * Sets the minor version of this archive
-     *
+     * 
      * @param version
      *            the minor version of the archive
      * @throws Pack200Exception
@@ -132,7 +131,7 @@
 
     /**
      * Sets the major version of this archive.
-     *
+     * 
      * @param version
      *            the minor version of the archive
      * @throws Pack200Exception
@@ -140,7 +139,8 @@
      */
     private void setArchiveMajorVersion(int version) throws Pack200Exception {
         if (version != 150)
-            throw new Pack200Exception("Invalid segment major version: " + version);
+            throw new Pack200Exception("Invalid segment major version: "
+                    + version);
         archiveMajor = version;
     }
 
@@ -236,11 +236,11 @@
      * Obtain the band headers data as an input stream. If no band headers are
      * present, this will return an empty input stream to prevent any further
      * reads taking place.
-     *
+     * 
      * Note that as a stream, data consumed from this input stream can't be
      * re-used. Data is only read from this stream if the encoding is such that
      * additional information needs to be decoded from the stream itself.
-     *
+     * 
      * @return the band headers input stream
      */
     public InputStream getBandHeadersInputStream() {
@@ -272,14 +272,15 @@
                     Codec.UNSIGNED5));
             setArchiveModtime(decodeScalar("archive_modtime", in,
                     Codec.UNSIGNED5));
-            numberOfFiles = (int)decodeScalar("file_count", in, Codec.UNSIGNED5);
+            numberOfFiles = (int) decodeScalar("file_count", in,
+                    Codec.UNSIGNED5);
         }
     }
 
     private void parseArchiveSpecialCounts(InputStream in) throws IOException,
             Pack200Exception {
         if (getOptions().hasSpecialFormats()) {
-            bandHeadersSize = (int)decodeScalar("band_headers_size", in,
+            bandHeadersSize = (int) decodeScalar("band_headers_size", in,
                     Codec.UNSIGNED5);
             setAttributeDefinitionCount(decodeScalar("attr_definition_count",
                     in, Codec.UNSIGNED5));
@@ -288,38 +289,44 @@
 
     private void parseClassCounts(InputStream in) throws IOException,
             Pack200Exception {
-        innerClassCount = (int)decodeScalar("ic_count", in, Codec.UNSIGNED5);
-        defaultClassMinorVersion = (int)decodeScalar("default_class_minver", in,
-                Codec.UNSIGNED5);
-        defaultClassMajorVersion = (int)decodeScalar("default_class_majver", in,
-                Codec.UNSIGNED5);
-        classCount = (int)decodeScalar("class_count", in, Codec.UNSIGNED5);
+        innerClassCount = (int) decodeScalar("ic_count", in, Codec.UNSIGNED5);
+        defaultClassMinorVersion = (int) decodeScalar("default_class_minver",
+                in, Codec.UNSIGNED5);
+        defaultClassMajorVersion = (int) decodeScalar("default_class_majver",
+                in, Codec.UNSIGNED5);
+        classCount = (int) decodeScalar("class_count", in, Codec.UNSIGNED5);
     }
 
     private void parseCpCounts(InputStream in) throws IOException,
             Pack200Exception {
-        cpUTF8Count = (int)decodeScalar("cp_Utf8_count", in, Codec.UNSIGNED5);
+        cpUTF8Count = (int) decodeScalar("cp_Utf8_count", in, Codec.UNSIGNED5);
         if (getOptions().hasCPNumberCounts()) {
-            cpIntCount = (int)decodeScalar("cp_Int_count", in, Codec.UNSIGNED5);
-            cpFloatCount = (int)decodeScalar("cp_Float_count", in, Codec.UNSIGNED5);
-            cpLongCount = (int)decodeScalar("cp_Long_count", in, Codec.UNSIGNED5);
-            cpDoubleCount = (int)decodeScalar("cp_Double_count", in,
+            cpIntCount = (int) decodeScalar("cp_Int_count", in, Codec.UNSIGNED5);
+            cpFloatCount = (int) decodeScalar("cp_Float_count", in,
+                    Codec.UNSIGNED5);
+            cpLongCount = (int) decodeScalar("cp_Long_count", in,
+                    Codec.UNSIGNED5);
+            cpDoubleCount = (int) decodeScalar("cp_Double_count", in,
                     Codec.UNSIGNED5);
         }
-        cpStringCount = (int)decodeScalar("cp_String_count", in, Codec.UNSIGNED5);
-        cpClassCount = (int)decodeScalar("cp_Class_count", in, Codec.UNSIGNED5);
-        cpSignatureCount = (int)decodeScalar("cp_Signature_count", in,
+        cpStringCount = (int) decodeScalar("cp_String_count", in,
+                Codec.UNSIGNED5);
+        cpClassCount = (int) decodeScalar("cp_Class_count", in, Codec.UNSIGNED5);
+        cpSignatureCount = (int) decodeScalar("cp_Signature_count", in,
+                Codec.UNSIGNED5);
+        cpDescriptorCount = (int) decodeScalar("cp_Descr_count", in,
+                Codec.UNSIGNED5);
+        cpFieldCount = (int) decodeScalar("cp_Field_count", in, Codec.UNSIGNED5);
+        cpMethodCount = (int) decodeScalar("cp_Method_count", in,
+                Codec.UNSIGNED5);
+        cpIMethodCount = (int) decodeScalar("cp_Imethod_count", in,
                 Codec.UNSIGNED5);
-        cpDescriptorCount = (int)decodeScalar("cp_Descr_count", in, Codec.UNSIGNED5);
-        cpFieldCount = (int)decodeScalar("cp_Field_count", in, Codec.UNSIGNED5);
-        cpMethodCount = (int)decodeScalar("cp_Method_count", in, Codec.UNSIGNED5);
-        cpIMethodCount = (int)decodeScalar("cp_Imethod_count", in, Codec.UNSIGNED5);
     }
 
     /**
      * Decode a number of scalars from the band file. A scalar is like a band,
      * but does not perform any band code switching.
-     *
+     * 
      * @param name
      *            the name of the scalar (primarily for logging/debugging
      *            purposes)
@@ -337,14 +344,15 @@
      */
     private long[] decodeScalar(String name, InputStream in, BHSDCodec codec,
             int n) throws IOException, Pack200Exception {
-        segment.log(Segment.LOG_LEVEL_VERBOSE, "Parsed #" + name + " (" + n + ")");
+        segment.log(Segment.LOG_LEVEL_VERBOSE, "Parsed #" + name + " (" + n
+                + ")");
         return codec.decode(n, in);
     }
 
     /**
      * Decode a scalar from the band file. A scalar is like a band, but does not
      * perform any band code switching.
-     *
+     * 
      * @param name
      *            the name of the scalar (primarily for logging/debugging
      *            purposes)
@@ -362,8 +370,10 @@
      */
     private long decodeScalar(String name, InputStream in, BHSDCodec codec)
             throws IOException, Pack200Exception {
-        long ret =  codec.decode(in);
-        segment.log(Segment.LOG_LEVEL_VERBOSE, "Parsed #" + name + " as " + ret);
+        long ret = codec.decode(in);
+        segment
+                .log(Segment.LOG_LEVEL_VERBOSE, "Parsed #" + name + " as "
+                        + ret);
         return ret;
     }
 
@@ -391,7 +401,7 @@
      * Completely reads in a byte array, akin to the implementation in
      * {@link java.lang.DataInputStream}. TODO Refactor out into a separate
      * InputStream handling class
-     *
+     * 
      * @param in
      *            the input stream to read from
      * @param data
@@ -402,8 +412,8 @@
      *             if a problem occurs with an unexpected value or unsupported
      *             codec
      */
-    private void readFully(InputStream in, byte[] data)
-            throws IOException, Pack200Exception {
+    private void readFully(InputStream in, byte[] data) throws IOException,
+            Pack200Exception {
         int total = in.read(data);
         if (total == -1)
             throw new EOFException("Failed to read any data from input stream");

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentOptions.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentOptions.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentOptions.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentOptions.java Fri Apr 11 03:09:38 2008
@@ -25,99 +25,100 @@
  * instead.
  */
 public class SegmentOptions {
-	private static final int DEFLATE_HINT = 1 << 5;
 
-	private static final int HAVE_ALL_CODE_FLAGS = 1 << 2;
+    private static final int DEFLATE_HINT = 1 << 5;
 
-	private static final int HAVE_CLASS_FLAGS_HI = 1 << 9;
+    private static final int HAVE_ALL_CODE_FLAGS = 1 << 2;
 
-	// private static final int UNUSED_3 = 2^3;
+    private static final int HAVE_CLASS_FLAGS_HI = 1 << 9;
 
-	private static final int HAVE_CODE_FLAGS_HI = 1 << 10;
+    // private static final int UNUSED_3 = 2^3;
 
-	private static final int HAVE_CP_NUMBERS = 1 << 1;
+    private static final int HAVE_CODE_FLAGS_HI = 1 << 10;
 
-	private static final int HAVE_FIELD_FLAGS_HI = 1 << 10;
+    private static final int HAVE_CP_NUMBERS = 1 << 1;
 
-	private static final int HAVE_FILE_HEADERS = 1 << 4;
+    private static final int HAVE_FIELD_FLAGS_HI = 1 << 10;
 
-	private static final int HAVE_FILE_MODTIME = 1 << 6;
+    private static final int HAVE_FILE_HEADERS = 1 << 4;
 
-	private static final int HAVE_FILE_OPTIONS = 1 << 7;
+    private static final int HAVE_FILE_MODTIME = 1 << 6;
 
-	private static final int HAVE_FILE_SIZE_HI = 1 << 8;
+    private static final int HAVE_FILE_OPTIONS = 1 << 7;
 
-	private static final int HAVE_METHOD_FLAGS_HI = 1 << 11;
+    private static final int HAVE_FILE_SIZE_HI = 1 << 8;
 
-	private static final int HAVE_SPECIAL_FORMATS = 1 << 0;
+    private static final int HAVE_METHOD_FLAGS_HI = 1 << 11;
 
-	/**
-	 * The bit flags that are defined as unused by the specification;
-	 * specifically, every bit above bit 13 and bit 3.
-	 */
-	private static final int UNUSED = -1 << 13 | 1 << 3;
+    private static final int HAVE_SPECIAL_FORMATS = 1 << 0;
 
-	private int options;
+    /**
+     * The bit flags that are defined as unused by the specification;
+     * specifically, every bit above bit 13 and bit 3.
+     */
+    private static final int UNUSED = -1 << 13 | 1 << 3;
 
-	/**
-	 * Creates a new segment options with the given integer value.
-	 *
-	 * @param options
-	 *            the integer value to use as the flags
-	 * @throws Pack200Exception
-	 *             if an unused bit (bit 3 or bit 13+) is non-zero
-	 */
-	public SegmentOptions(int options) throws Pack200Exception {
-		if ((options & UNUSED) != 0)
-			throw new Pack200Exception("Some unused flags are non-zero");
-		this.options = options;
-	}
+    private int options;
 
-	public boolean hasAllCodeFlags() {
-		return (options & HAVE_ALL_CODE_FLAGS) != 0;
-	}
+    /**
+     * Creates a new segment options with the given integer value.
+     * 
+     * @param options
+     *            the integer value to use as the flags
+     * @throws Pack200Exception
+     *             if an unused bit (bit 3 or bit 13+) is non-zero
+     */
+    public SegmentOptions(int options) throws Pack200Exception {
+        if ((options & UNUSED) != 0)
+            throw new Pack200Exception("Some unused flags are non-zero");
+        this.options = options;
+    }
 
-	public boolean hasArchiveFileCounts() {
-		return (options & HAVE_FILE_HEADERS) != 0;
-	}
+    public boolean hasAllCodeFlags() {
+        return (options & HAVE_ALL_CODE_FLAGS) != 0;
+    }
 
-	public boolean hasClassFlagsHi() {
-		return (options & HAVE_CLASS_FLAGS_HI) != 0;
-	}
+    public boolean hasArchiveFileCounts() {
+        return (options & HAVE_FILE_HEADERS) != 0;
+    }
 
-	public boolean hasCodeFlagsHi() {
-		return (options & HAVE_CODE_FLAGS_HI) != 0;
-	}
+    public boolean hasClassFlagsHi() {
+        return (options & HAVE_CLASS_FLAGS_HI) != 0;
+    }
 
-	public boolean hasCPNumberCounts() {
-		return (options & HAVE_CP_NUMBERS) != 0;
-	}
+    public boolean hasCodeFlagsHi() {
+        return (options & HAVE_CODE_FLAGS_HI) != 0;
+    }
 
-	public boolean hasFieldFlagsHi() {
-		return (options & HAVE_FIELD_FLAGS_HI) != 0;
-	}
+    public boolean hasCPNumberCounts() {
+        return (options & HAVE_CP_NUMBERS) != 0;
+    }
 
-	public boolean hasFileModtime() {
-		return (options & HAVE_FILE_MODTIME) != 0;
-	}
+    public boolean hasFieldFlagsHi() {
+        return (options & HAVE_FIELD_FLAGS_HI) != 0;
+    }
 
-	public boolean hasFileOptions() {
-		return (options & HAVE_FILE_OPTIONS) != 0;
-	}
+    public boolean hasFileModtime() {
+        return (options & HAVE_FILE_MODTIME) != 0;
+    }
 
-	public boolean hasFileSizeHi() {
-		return (options & HAVE_FILE_SIZE_HI) != 0;
-	}
+    public boolean hasFileOptions() {
+        return (options & HAVE_FILE_OPTIONS) != 0;
+    }
 
-	public boolean hasMethodFlagsHi() {
-		return (options & HAVE_METHOD_FLAGS_HI) != 0;
-	}
+    public boolean hasFileSizeHi() {
+        return (options & HAVE_FILE_SIZE_HI) != 0;
+    }
 
-	public boolean hasSpecialFormats() {
-		return (options & HAVE_SPECIAL_FORMATS) != 0;
-	}
+    public boolean hasMethodFlagsHi() {
+        return (options & HAVE_METHOD_FLAGS_HI) != 0;
+    }
 
-	public boolean shouldDeflate() {
-		return (options & DEFLATE_HINT) != 0;
-	}
+    public boolean hasSpecialFormats() {
+        return (options & HAVE_SPECIAL_FORMATS) != 0;
+    }
+
+    public boolean shouldDeflate() {
+        return (options & DEFLATE_HINT) != 0;
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentUtils.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentUtils.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentUtils.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentUtils.java Fri Apr 11 03:09:38 2008
@@ -21,69 +21,71 @@
  */
 public final class SegmentUtils {
 
-	public static int countArgs(String descriptor) {
-	    return countArgs(descriptor, 1);
-	}
-
-	public static int countInvokeInterfaceArgs(String descriptor) {
-	    return countArgs(descriptor, 2);
-	}
-
-	/**
-	 * Count the number of arguments in the descriptor. Each
-	 * long or double counts as widthOfLongsAndDoubles; all other
-	 * arguments count as 1.
-	 * @param descriptor String for which arguments are counted
-	 * @param widthOfLongsAndDoubles int increment to apply for longs
-	 *   doubles. This is typically 1 when counting arguments alone,
-	 *   or 2 when counting arguments for invokeinterface.
-	 * @return integer count
-	 */
-	protected static int countArgs(String descriptor, int widthOfLongsAndDoubles) {
-	    int bra = descriptor.indexOf("(");
-	    int ket = descriptor.indexOf(")");
-	    if (bra == -1 || ket == -1 || ket < bra)
-	        throw new IllegalArgumentException("No arguments");
-
-	    boolean inType = false;
-	    boolean consumingNextType = false;
-	    int count = 0;
-	    for (int i = bra + 1; i < ket; i++) {
-	        char charAt = descriptor.charAt(i);
-	        if (inType && charAt == ';') {
-	            inType = false;
-	            consumingNextType = false;
-	        } else if (!inType && charAt == 'L') {
-	            inType = true;
-	            count++;
-	        } else if (charAt == '[') {
-	            consumingNextType = true;
-	        } else if(inType) {
-	            // NOP
-	        } else {
-	            if(consumingNextType) {
-	                count++;
-	                consumingNextType = false;
-	            } else {
-	                if(charAt == 'D' || charAt == 'J') {
-	                    count+=widthOfLongsAndDoubles;
-	                } else {
-	                    count++;
-	                }
-	            }
-	        }
-	    }
-	    return count;
-	}
-
-	public static int countMatches(long[] flags, IMatcher matcher) {
-		int count = 0;
-		for (int i = 0; i < flags.length; i++) {
-			if (matcher.matches(flags[i]))
-				count++;
-		}
-		return count;
-	}
+    public static int countArgs(String descriptor) {
+        return countArgs(descriptor, 1);
+    }
+
+    public static int countInvokeInterfaceArgs(String descriptor) {
+        return countArgs(descriptor, 2);
+    }
+
+    /**
+     * Count the number of arguments in the descriptor. Each long or double
+     * counts as widthOfLongsAndDoubles; all other arguments count as 1.
+     * 
+     * @param descriptor
+     *            String for which arguments are counted
+     * @param widthOfLongsAndDoubles
+     *            int increment to apply for longs doubles. This is typically 1
+     *            when counting arguments alone, or 2 when counting arguments
+     *            for invokeinterface.
+     * @return integer count
+     */
+    protected static int countArgs(String descriptor, int widthOfLongsAndDoubles) {
+        int bra = descriptor.indexOf("(");
+        int ket = descriptor.indexOf(")");
+        if (bra == -1 || ket == -1 || ket < bra)
+            throw new IllegalArgumentException("No arguments");
+
+        boolean inType = false;
+        boolean consumingNextType = false;
+        int count = 0;
+        for (int i = bra + 1; i < ket; i++) {
+            char charAt = descriptor.charAt(i);
+            if (inType && charAt == ';') {
+                inType = false;
+                consumingNextType = false;
+            } else if (!inType && charAt == 'L') {
+                inType = true;
+                count++;
+            } else if (charAt == '[') {
+                consumingNextType = true;
+            } else if (inType) {
+                // NOP
+            } else {
+                if (consumingNextType) {
+                    count++;
+                    consumingNextType = false;
+                } else {
+                    if (charAt == 'D' || charAt == 'J') {
+                        count += widthOfLongsAndDoubles;
+                    } else {
+                        count++;
+                    }
+                }
+            }
+        }
+        return count;
+    }
+
+    public static int countMatches(long[] flags, IMatcher matcher) {
+        int count = 0;
+        for (int i = 0; i < flags.length; i++) {
+            if (matcher.matches(flags[i]))
+                count++;
+        }
+        return count;
+    }
 
     public static int countBit16(int[] flags) {
         int count = 0;
@@ -114,41 +116,42 @@
         return count;
     }
 
-	public static int countMatches(long[][] flags, IMatcher matcher) {
-		int count = 0;
-		for (int i = 0; i < flags.length; i++) {
-			count += countMatches(flags[i], matcher);
-		}
-		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
-	}
+    public static int countMatches(long[][] flags, IMatcher matcher) {
+        int count = 0;
+        for (int i = 0; i < flags.length; i++) {
+            count += countMatches(flags[i], matcher);
+        }
+        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.pack200' is set, this will
-	 * generate messages to stderr; otherwise, it will be silent.
-     *
+     * This is a debugging message to aid the developer in writing this class.
+     * If the property 'debug.pack200' is set, this will generate messages to
+     * stderr; otherwise, it will be silent.
+     * 
      * @param message
      * @deprecated this may be removed from production code
      */

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/AnnotationDefaultAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/AnnotationDefaultAttribute.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/AnnotationDefaultAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/AnnotationDefaultAttribute.java Fri Apr 11 03:09:38 2008
@@ -26,7 +26,8 @@
 
     private final ElementValue element_value;
 
-    private static final CPUTF8 attributeName = new CPUTF8("AnnotationDefault", ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ);
+    private static final CPUTF8 attributeName = new CPUTF8("AnnotationDefault",
+            ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ);
 
     public AnnotationDefaultAttribute(ElementValue element_value) {
         super(attributeName);

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/AnnotationsAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/AnnotationsAttribute.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/AnnotationsAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/AnnotationsAttribute.java Fri Apr 11 03:09:38 2008
@@ -24,7 +24,6 @@
  */
 public abstract class AnnotationsAttribute extends Attribute {
 
-
     /**
      * Class to represent the annotation structure for class file attributes
      */
@@ -39,8 +38,8 @@
         private int type_index;
         private int[] name_indexes;
 
-
-        public Annotation(int num_pairs, CPUTF8 type, CPUTF8[] element_names, ElementValue[] element_values) {
+        public Annotation(int num_pairs, CPUTF8 type, CPUTF8[] element_names,
+                ElementValue[] element_values) {
             this.num_pairs = num_pairs;
             this.type = type;
             this.element_names = element_names;
@@ -92,18 +91,18 @@
         }
 
         public void resolve(ClassConstantPool pool) {
-            if(value instanceof CPConstant) {
-                ((CPConstant)value).resolve(pool);
-                constant_value_index = pool.indexOf((CPConstant)value);
+            if (value instanceof CPConstant) {
+                ((CPConstant) value).resolve(pool);
+                constant_value_index = pool.indexOf((CPConstant) value);
             } else if (value instanceof CPClass) {
-                ((CPClass)value).resolve(pool);
-                constant_value_index = pool.indexOf((CPClass)value);
+                ((CPClass) value).resolve(pool);
+                constant_value_index = pool.indexOf((CPClass) value);
             } else if (value instanceof CPNameAndType) {
-                ((CPNameAndType)value).resolve(pool);
+                ((CPNameAndType) value).resolve(pool);
             } else if (value instanceof Annotation) {
-                ((Annotation)value).resolve(pool);
+                ((Annotation) value).resolve(pool);
             } else if (value instanceof ElementValue[]) {
-                ElementValue[] nestedValues = (ElementValue[])value;
+                ElementValue[] nestedValues = (ElementValue[]) value;
                 for (int i = 0; i < nestedValues.length; i++) {
                     nestedValues[i].resolve(pool);
                 }
@@ -112,14 +111,14 @@
 
         public void writeBody(DataOutputStream dos) throws IOException {
             dos.writeByte(tag);
-            if(constant_value_index != -1) {
+            if (constant_value_index != -1) {
                 dos.writeShort(constant_value_index);
             } else if (value instanceof CPNameAndType) {
-                ((CPNameAndType)value).writeBody(dos);
+                ((CPNameAndType) value).writeBody(dos);
             } else if (value instanceof Annotation) {
-                ((Annotation)value).writeBody(dos);
+                ((Annotation) value).writeBody(dos);
             } else if (value instanceof ElementValue[]) {
-                ElementValue[] nestedValues = (ElementValue[])value;
+                ElementValue[] nestedValues = (ElementValue[]) value;
                 for (int i = 0; i < nestedValues.length; i++) {
                     nestedValues[i].writeBody(dos);
                 }
@@ -127,7 +126,7 @@
         }
 
         public int getLength() {
-            switch(tag) {
+            switch (tag) {
             case 'B':
             case 'C':
             case 'D':
@@ -142,13 +141,13 @@
                 return 5;
             case '[':
                 int length = 3;
-                ElementValue[] nestedValues = (ElementValue[])value;
+                ElementValue[] nestedValues = (ElementValue[]) value;
                 for (int i = 0; i < nestedValues.length; i++) {
                     length += nestedValues[i].getLength();
                 }
                 return length;
             case '@':
-                return (1 + ((Annotation)value).getLength());
+                return (1 + ((Annotation) value).getLength());
             }
             return 0;
         }
@@ -157,7 +156,5 @@
     public AnnotationsAttribute(CPUTF8 attributeName) {
         super(attributeName);
     }
-
-
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/Attribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/Attribute.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/Attribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/Attribute.java Fri Apr 11 03:09:38 2008
@@ -23,6 +23,7 @@
  * Abstract superclass for class file attributes
  */
 public abstract class Attribute extends ClassFileEntry {
+
     protected final CPUTF8 attributeName;
 
     private int attributeNameIndex;
@@ -65,7 +66,7 @@
      * when attributes are nested within other attributes - the outer attribute
      * needs to take the inner attribute headers into account when calculating
      * its length.
-     *
+     * 
      * @return int adjusted length
      */
     protected int getLengthIncludingHeader() {
@@ -79,7 +80,7 @@
     /**
      * Answer true if the receiver needs to have BCI renumbering applied to it;
      * otherwise answer false.
-     *
+     * 
      * @return boolean BCI renumbering required
      */
     public boolean hasBCIRenumbering() {
@@ -87,10 +88,9 @@
     }
 
     /**
-     * Answer true if the receiver is a source file attribute
-     * (which gets special handling when the class is built);
-     * otherwise answer false.
-     *
+     * Answer true if the receiver is a source file attribute (which gets
+     * special handling when the class is built); otherwise answer false.
+     * 
      * @return boolean source file attribute
      */
     public boolean isSourceFileAttribute() {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/BCIRenumberedAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/BCIRenumberedAttribute.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/BCIRenumberedAttribute.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/BCIRenumberedAttribute.java Fri Apr 11 03:09:38 2008
@@ -30,7 +30,9 @@
 
     protected boolean renumbered = false;
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.harmony.pack200.bytecode.Attribute#hasBCIRenumbering()
      */
     public boolean hasBCIRenumbering() {
@@ -42,28 +44,33 @@
     }
 
     protected abstract int getLength();
+
     protected abstract void writeBody(DataOutputStream dos) throws IOException;
+
     public abstract String toString();
+
     protected abstract int[] getStartPCs();
 
     /**
-     * In Pack200, line number tables are BCI renumbered.
-     * This method takes the byteCodeOffsets (which is
-     * a List of Integers specifying the offset in the
-     * byte code array of each instruction) and updates the
-     * start_pcs so that it points to the instruction index
-     * itself, not the BCI renumbering of the instruction.
-     *
-     * @param byteCodeOffsets List of Integer offsets of the bytecode array
+     * In Pack200, line number tables are BCI renumbered. This method takes the
+     * byteCodeOffsets (which is a List of Integers specifying the offset in the
+     * byte code array of each instruction) and updates the start_pcs so that it
+     * points to the instruction index itself, not the BCI renumbering of the
+     * instruction.
+     * 
+     * @param byteCodeOffsets
+     *            List of Integer offsets of the bytecode array
      */
     public void renumber(List byteCodeOffsets) throws Pack200Exception {
-        if(renumbered) {
-            throw new Error("Trying to renumber a line number table that has already been renumbered");
+        if (renumbered) {
+            throw new Error(
+                    "Trying to renumber a line number table that has already been renumbered");
         }
         renumbered = true;
         int[] startPCs = getStartPCs();
-        for(int index=0; index < startPCs.length; index++) {
-            startPCs[index] = ((Integer)byteCodeOffsets.get(startPCs[index])).intValue();
+        for (int index = 0; index < startPCs.length; index++) {
+            startPCs[index] = ((Integer) byteCodeOffsets.get(startPCs[index]))
+                    .intValue();
         }
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ByteCode.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ByteCode.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ByteCode.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ByteCode.java Fri Apr 11 03:09:38 2008
@@ -27,296 +27,308 @@
  */
 public class ByteCode extends ClassFileEntry {
 
-	public static ByteCode getByteCode(int opcode) {
-		return new ByteCode(0xFF & opcode);
-	}
-
-	private final ByteCodeForm byteCodeForm;
-
-	private ClassFileEntry[] nested;
-	private int[][] nestedPositions;
-	private int[] rewrite;
+    public static ByteCode getByteCode(int opcode) {
+        return new ByteCode(0xFF & opcode);
+    }
+
+    private final ByteCodeForm byteCodeForm;
+
+    private ClassFileEntry[] nested;
+    private int[][] nestedPositions;
+    private int[] rewrite;
 
     private int byteCodeOffset = -1;
     private int[] byteCodeTargets = null;
 
-	protected ByteCode(int opcode) {
-		this(opcode, ClassFileEntry.NONE);
-	}
-
-	protected ByteCode(int opcode, ClassFileEntry[] nested) {
-		this.byteCodeForm = ByteCodeForm.get(opcode);
-		this.rewrite = byteCodeForm.getRewriteCopy();
-		this.nested = nested;
-	}
-
-	protected void doWrite(DataOutputStream dos) throws IOException {
-		for (int i = 0; i < rewrite.length; i++) {
-			dos.writeByte(rewrite[i]);
-		}
-	}
-
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-		if (obj == null)
-			return false;
-		if (getClass() != obj.getClass())
-			return false;
-		final ByteCode other = (ByteCode) obj;
-		if (getByteCodeForm() != other.getByteCodeForm())
-			return false;
-		if (rewrite != other.rewrite)
-			return false;
-		return true;
-	}
-
-	public void extractOperands(OperandManager operandManager, Segment segment, int codeLength) {
-		// Given an OperandTable, figure out which operands
-		// the receiver needs and stuff them in operands.
-		// Later on the operands can be rewritten (But that's
-		// later, not now).
-		ByteCodeForm currentByteCodeForm = getByteCodeForm();
-		currentByteCodeForm.setByteCodeOperands(this, operandManager, codeLength);
-	}
-
-	protected ByteCodeForm getByteCodeForm() {
-		return byteCodeForm;
-	}
-
-	public int getLength() {
-		return rewrite.length;
-	}
-
-	public String getName() {
-		return getByteCodeForm().getName();
-	}
-
-	public ClassFileEntry[] getNestedClassFileEntries() {
-		return nested;
-	}
-
-	public int getOpcode() {
-		return getByteCodeForm().getOpcode();
-	}
-
-	public int getOperandType() {
-		return getByteCodeForm().getOperandType();
-	}
-
-	public int hashCode() {
-		final int prime = 31;
-		int result = 1;
-		result = prime * result + getByteCodeForm().getOpcode();
-		// Don't forget to take the operands = rewrite into account
-		for (int index = 1; index < rewrite.length; index++) {
-			result = result + rewrite[index];
-		}
-		return result;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.apache.harmony.pack200.bytecode.ClassFileEntry#resolve(org.apache.harmony.pack200.bytecode.ClassConstantPool)
-	 */
-	protected void resolve(ClassConstantPool pool) {
-		super.resolve(pool);
-		if(nested.length > 0) {
-			// Update the bytecode rewrite array so that it points
-			// to the elements of the nested array.
-			for(int index = 0; index < nested.length; index++) {
-				int argLength = getNestedPosition(index)[1];
-				switch(argLength) {
-
-				case 1:
-					setOperandByte(pool.indexOf(nested[index]), getNestedPosition(index)[0]);
-					break;
-
-				case 2:
-					setOperand2Bytes(pool.indexOf(nested[index]), getNestedPosition(index)[0]);
-					break;
-
-				default:
-					throw new Error("Unhandled resolve " + this);
-				}
-			}
-		}
-	}
-
-	/**
-	 * Given an array of ints which correspond to bytes in the
-	 * operand of the bytecode, set the rewrite bytes of the
-	 * operand to be the appropriate values. All values in
-	 * operands[] will be masked with 0xFF so they fit into
-	 * a byte.
-	 * @param operands int[] rewrite operand bytes
-	 */
-	public void setOperandBytes(int[] operands) {
-		int firstOperandIndex = getByteCodeForm().firstOperandIndex();
-		int byteCodeFormLength = getByteCodeForm().operandLength();
-		if (firstOperandIndex < 1) {
-			// No operand rewriting permitted for this bytecode
-			throw new Error("Trying to rewrite " + this + " that has no rewrite");
-		}
-
-		if(byteCodeFormLength != operands.length) {
-			throw new Error("Trying to rewrite " + this + " with " + operands.length + " but bytecode has length " + byteCodeForm.operandLength());
-		}
-
-		for(int index=0; index < byteCodeFormLength; index++) {
-			rewrite[index + firstOperandIndex] = operands[index] & 0xFF;
-		}
-	}
-
-	/**
-	 * Given an int operand, set the rewrite bytes for
-	 * that position and the one immediately following it
-	 * to a high-byte, low-byte encoding of the operand.
-	 *
-	 * @param operand int to set the rewrite bytes to
-	 * @param position int position in the operands of the
-	 * 	rewrite bytes. For a rewrite array of {100, -1, -1, -1}
-	 *  position 0 is the first -1, position 1 is the second -1,
-	 *  etc.
-	 */
-	public void setOperand2Bytes(int operand, int position) {
-		int firstOperandIndex = getByteCodeForm().firstOperandIndex();
-		int byteCodeFormLength = getByteCodeForm().getRewrite().length;
-		if (firstOperandIndex < 1) {
-			// No operand rewriting permitted for this bytecode
-			throw new Error("Trying to rewrite " + this + " that has no rewrite");
-		}
-
-		if(firstOperandIndex + position + 1 > byteCodeFormLength) {
-			throw new Error("Trying to rewrite " + this + " with an int at position " + position + " but this won't fit in the rewrite array");
-		}
-
-	    rewrite[firstOperandIndex + position] = (operand & 0xFF00) >> 8;
-	    rewrite[firstOperandIndex + position + 1] = operand & 0xFF;
-	}
-
-	/**
-	 * This is just like setOperandInt, but takes special care when the
-	 * operand is less than 0 to make sure it's written correctly.
-	 * @param operand int to set the rewrite bytes to
-	 * @param position int position of the operands in the rewrite bytes
-	 */
-	public void setOperandSigned2Bytes(int operand, int position) {
-	    if(operand >= 0) {
-	        setOperand2Bytes(operand, position);
-	    } else {
-	        int twosComplementOperand = 0x10000 + operand;
-	        setOperand2Bytes(twosComplementOperand, position);
-	    }
-	}
-
-	/**
-	 * Given an int operand, treat it as a byte and set
-	 * the rewrite byte for that position to that value.
-	 * Mask of anything beyond 0xFF.
-	 *
-	 * @param operand int to set the rewrite byte to (unsigned)
-	 * @param position int position in the operands of the
-	 * 	rewrite bytes. For a rewrite array of {100, -1, -1, -1}
-	 *  position 0 is the first -1, position 1 is the second -1,
-	 *  etc.
-	 */
-	public void setOperandByte(int operand, int position) {
-		int firstOperandIndex = getByteCodeForm().firstOperandIndex();
-		int byteCodeFormLength = getByteCodeForm().operandLength();
-		if (firstOperandIndex < 1) {
-			// No operand rewriting permitted for this bytecode
-			throw new Error("Trying to rewrite " + this + " that has no rewrite");
-		}
-
-		if(firstOperandIndex + position > byteCodeFormLength) {
-			throw new Error("Trying to rewrite " + this + " with an byte at position " + position + " but this won't fit in the rewrite array");
-		}
-
-		rewrite[firstOperandIndex + position] = operand & 0xFF;
-	}
-
-
-	public String toString() {
-		return getByteCodeForm().getName();
-	}
-
-	public void setNested(ClassFileEntry[] nested) {
-		this.nested = nested;
-	}
-
-	/**
-	 * nestedPositions is an array of arrays of ints. Each
-	 * subarray specifies a position of a nested
-	 * element (from the nested[] array) and the length of
-	 * that element.
-	 *
-	 * For instance, one might have a nested of:
-	 * 	{CPClass java/lang/Foo, CPFloat 3.14}
-	 * The nestedPositions would then be:
-	 * 	{{0,2},{2,2}}
-	 * In other words, when the bytecode is resolved, the
-	 * CPClass will be resolved to an int and inserted
-	 * at position 0 and 1 of the rewrite arguments (the first
-	 * occurrences of -1). The CPFloat will be resolved to
-	 * an int position and inserted at positions 2 and 3 of
-	 * the rewrite arguments.
-	 *
-	 * @param nestedPositions
-	 */
-	public void setNestedPositions(int[][] nestedPositions) {
-		this.nestedPositions = nestedPositions;
-	}
-
-	public int[][] getNestedPositions() {
-		return nestedPositions;
-	}
-
-	public int[] getNestedPosition(int index) {
-		return getNestedPositions()[index];
-	}
-
-    /**
-     * This method will answer true if the receiver is
-     * a multi-bytecode instruction (such as
-     * aload0_putfield_super); otherwise, it will answer
+    protected ByteCode(int opcode) {
+        this(opcode, ClassFileEntry.NONE);
+    }
+
+    protected ByteCode(int opcode, ClassFileEntry[] nested) {
+        this.byteCodeForm = ByteCodeForm.get(opcode);
+        this.rewrite = byteCodeForm.getRewriteCopy();
+        this.nested = nested;
+    }
+
+    protected void doWrite(DataOutputStream dos) throws IOException {
+        for (int i = 0; i < rewrite.length; i++) {
+            dos.writeByte(rewrite[i]);
+        }
+    }
+
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        final ByteCode other = (ByteCode) obj;
+        if (getByteCodeForm() != other.getByteCodeForm())
+            return false;
+        if (rewrite != other.rewrite)
+            return false;
+        return true;
+    }
+
+    public void extractOperands(OperandManager operandManager, Segment segment,
+            int codeLength) {
+        // Given an OperandTable, figure out which operands
+        // the receiver needs and stuff them in operands.
+        // Later on the operands can be rewritten (But that's
+        // later, not now).
+        ByteCodeForm currentByteCodeForm = getByteCodeForm();
+        currentByteCodeForm.setByteCodeOperands(this, operandManager,
+                codeLength);
+    }
+
+    protected ByteCodeForm getByteCodeForm() {
+        return byteCodeForm;
+    }
+
+    public int getLength() {
+        return rewrite.length;
+    }
+
+    public String getName() {
+        return getByteCodeForm().getName();
+    }
+
+    public ClassFileEntry[] getNestedClassFileEntries() {
+        return nested;
+    }
+
+    public int getOpcode() {
+        return getByteCodeForm().getOpcode();
+    }
+
+    public int getOperandType() {
+        return getByteCodeForm().getOperandType();
+    }
+
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + getByteCodeForm().getOpcode();
+        // Don't forget to take the operands = rewrite into account
+        for (int index = 1; index < rewrite.length; index++) {
+            result = result + rewrite[index];
+        }
+        return result;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.harmony.pack200.bytecode.ClassFileEntry#resolve(org.apache.harmony.pack200.bytecode.ClassConstantPool)
+     */
+    protected void resolve(ClassConstantPool pool) {
+        super.resolve(pool);
+        if (nested.length > 0) {
+            // Update the bytecode rewrite array so that it points
+            // to the elements of the nested array.
+            for (int index = 0; index < nested.length; index++) {
+                int argLength = getNestedPosition(index)[1];
+                switch (argLength) {
+
+                case 1:
+                    setOperandByte(pool.indexOf(nested[index]),
+                            getNestedPosition(index)[0]);
+                    break;
+
+                case 2:
+                    setOperand2Bytes(pool.indexOf(nested[index]),
+                            getNestedPosition(index)[0]);
+                    break;
+
+                default:
+                    throw new Error("Unhandled resolve " + this);
+                }
+            }
+        }
+    }
+
+    /**
+     * Given an array of ints which correspond to bytes in the operand of the
+     * bytecode, set the rewrite bytes of the operand to be the appropriate
+     * values. All values in operands[] will be masked with 0xFF so they fit
+     * into a byte.
+     * 
+     * @param operands
+     *            int[] rewrite operand bytes
+     */
+    public void setOperandBytes(int[] operands) {
+        int firstOperandIndex = getByteCodeForm().firstOperandIndex();
+        int byteCodeFormLength = getByteCodeForm().operandLength();
+        if (firstOperandIndex < 1) {
+            // No operand rewriting permitted for this bytecode
+            throw new Error("Trying to rewrite " + this
+                    + " that has no rewrite");
+        }
+
+        if (byteCodeFormLength != operands.length) {
+            throw new Error("Trying to rewrite " + this + " with "
+                    + operands.length + " but bytecode has length "
+                    + byteCodeForm.operandLength());
+        }
+
+        for (int index = 0; index < byteCodeFormLength; index++) {
+            rewrite[index + firstOperandIndex] = operands[index] & 0xFF;
+        }
+    }
+
+    /**
+     * Given an int operand, set the rewrite bytes for that position and the one
+     * immediately following it to a high-byte, low-byte encoding of the
+     * operand.
+     * 
+     * @param operand
+     *            int to set the rewrite bytes to
+     * @param position
+     *            int position in the operands of the rewrite bytes. For a
+     *            rewrite array of {100, -1, -1, -1} position 0 is the first -1,
+     *            position 1 is the second -1, etc.
+     */
+    public void setOperand2Bytes(int operand, int position) {
+        int firstOperandIndex = getByteCodeForm().firstOperandIndex();
+        int byteCodeFormLength = getByteCodeForm().getRewrite().length;
+        if (firstOperandIndex < 1) {
+            // No operand rewriting permitted for this bytecode
+            throw new Error("Trying to rewrite " + this
+                    + " that has no rewrite");
+        }
+
+        if (firstOperandIndex + position + 1 > byteCodeFormLength) {
+            throw new Error("Trying to rewrite " + this
+                    + " with an int at position " + position
+                    + " but this won't fit in the rewrite array");
+        }
+
+        rewrite[firstOperandIndex + position] = (operand & 0xFF00) >> 8;
+        rewrite[firstOperandIndex + position + 1] = operand & 0xFF;
+    }
+
+    /**
+     * This is just like setOperandInt, but takes special care when the operand
+     * is less than 0 to make sure it's written correctly.
+     * 
+     * @param operand
+     *            int to set the rewrite bytes to
+     * @param position
+     *            int position of the operands in the rewrite bytes
+     */
+    public void setOperandSigned2Bytes(int operand, int position) {
+        if (operand >= 0) {
+            setOperand2Bytes(operand, position);
+        } else {
+            int twosComplementOperand = 0x10000 + operand;
+            setOperand2Bytes(twosComplementOperand, position);
+        }
+    }
+
+    /**
+     * Given an int operand, treat it as a byte and set the rewrite byte for
+     * that position to that value. Mask of anything beyond 0xFF.
+     * 
+     * @param operand
+     *            int to set the rewrite byte to (unsigned)
+     * @param position
+     *            int position in the operands of the rewrite bytes. For a
+     *            rewrite array of {100, -1, -1, -1} position 0 is the first -1,
+     *            position 1 is the second -1, etc.
+     */
+    public void setOperandByte(int operand, int position) {
+        int firstOperandIndex = getByteCodeForm().firstOperandIndex();
+        int byteCodeFormLength = getByteCodeForm().operandLength();
+        if (firstOperandIndex < 1) {
+            // No operand rewriting permitted for this bytecode
+            throw new Error("Trying to rewrite " + this
+                    + " that has no rewrite");
+        }
+
+        if (firstOperandIndex + position > byteCodeFormLength) {
+            throw new Error("Trying to rewrite " + this
+                    + " with an byte at position " + position
+                    + " but this won't fit in the rewrite array");
+        }
+
+        rewrite[firstOperandIndex + position] = operand & 0xFF;
+    }
+
+    public String toString() {
+        return getByteCodeForm().getName();
+    }
+
+    public void setNested(ClassFileEntry[] nested) {
+        this.nested = nested;
+    }
+
+    /**
+     * nestedPositions is an array of arrays of ints. Each subarray specifies a
+     * position of a nested element (from the nested[] array) and the length of
+     * that element.
+     * 
+     * For instance, one might have a nested of: {CPClass java/lang/Foo, CPFloat
+     * 3.14} The nestedPositions would then be: {{0,2},{2,2}} In other words,
+     * when the bytecode is resolved, the CPClass will be resolved to an int and
+     * inserted at position 0 and 1 of the rewrite arguments (the first
+     * occurrences of -1). The CPFloat will be resolved to an int position and
+     * inserted at positions 2 and 3 of the rewrite arguments.
+     * 
+     * @param nestedPositions
+     */
+    public void setNestedPositions(int[][] nestedPositions) {
+        this.nestedPositions = nestedPositions;
+    }
+
+    public int[][] getNestedPositions() {
+        return nestedPositions;
+    }
+
+    public int[] getNestedPosition(int index) {
+        return getNestedPositions()[index];
+    }
+
+    /**
+     * This method will answer true if the receiver is a multi-bytecode
+     * instruction (such as aload0_putfield_super); otherwise, it will answer
      * false.
-     *
+     * 
      * @return boolean true if multibytecode, false otherwise
      */
-	public boolean hasMultipleByteCodes() {
-		return getByteCodeForm().hasMultipleByteCodes();
-	}
+    public boolean hasMultipleByteCodes() {
+        return getByteCodeForm().hasMultipleByteCodes();
+    }
 
     /**
-     * ByteCodes may need to know their position in the
-     * code array (in particular, label byte codes need
-     * to know where they are in order to calculate their
-     * targets). This method lets the CodeAttribute specify
+     * ByteCodes may need to know their position in the code array (in
+     * particular, label byte codes need to know where they are in order to
+     * calculate their targets). This method lets the CodeAttribute specify
      * where the byte code is.
-     *
-     * Since there are no aload0+label instructions, this
-     * method doesn't worry about multioperation bytecodes.
-     *
-     * @param byteCodeOffset int position in code array.
+     * 
+     * Since there are no aload0+label instructions, this method doesn't worry
+     * about multioperation bytecodes.
+     * 
+     * @param byteCodeOffset
+     *            int position in code array.
      */
     public void setByteCodeIndex(int byteCodeOffset) {
         this.byteCodeOffset = byteCodeOffset;
     }
 
-
     public int getByteCodeIndex() {
         return byteCodeOffset;
     }
 
     /**
-     * Some ByteCodes (in particular, those with labels)
-     * have to keep track of byteCodeTargets. These are
-     * initially offsets in the CodeAttribute array
-     * relative to the byteCodeOffset, but later get fixed
-     * up to point to the absolute position in the CodeAttribute
-     * array. This method sets the targets.
-     *
-     * @param byteCodeTargets int index in array
+     * Some ByteCodes (in particular, those with labels) have to keep track of
+     * byteCodeTargets. These are initially offsets in the CodeAttribute array
+     * relative to the byteCodeOffset, but later get fixed up to point to the
+     * absolute position in the CodeAttribute array. This method sets the
+     * targets.
+     * 
+     * @param byteCodeTargets
+     *            int index in array
      */
     public void setByteCodeTargets(int[] byteCodeTargets) {
         this.byteCodeTargets = byteCodeTargets;
@@ -327,25 +339,23 @@
     }
 
     /**
-     * Some ByteCodes (in particular, those with labels
-     * need to be fixed up after all the bytecodes in the
-     * CodeAttribute have been added. (This can't
-     * be done beforehand because the CodeAttribute needs
-     * to be complete before targets can be assigned.)
+     * Some ByteCodes (in particular, those with labels need to be fixed up
+     * after all the bytecodes in the CodeAttribute have been added. (This can't
+     * be done beforehand because the CodeAttribute needs to be complete before
+     * targets can be assigned.)
      */
     public void applyByteCodeTargetFixup(CodeAttribute codeAttribute) {
         getByteCodeForm().fixUpByteCodeTargets(this, codeAttribute);
     }
 
     /**
-     * Some bytecodes (the ones with variable lengths) can't
-     * have a static rewrite array - they need the ability to
-     * update the array. This method permits that.
-     *
-     * Note that this should not be called from bytecodes
-     * which have a static rewrite; use the table in ByteCodeForm
-     * instead to specify those rewrites.
-     *
+     * Some bytecodes (the ones with variable lengths) can't have a static
+     * rewrite array - they need the ability to update the array. This method
+     * permits that.
+     * 
+     * Note that this should not be called from bytecodes which have a static
+     * rewrite; use the table in ByteCodeForm instead to specify those rewrites.
+     * 
      * @param rewrite
      */
     public void setRewrite(int[] rewrite) {
@@ -353,14 +363,12 @@
     }
 
     /**
-     * Some bytecodes (the ones with variable lengths) can't
-     * have a static rewrite array - they need the ability to
-     * update the array. This method permits their associated
-     * bytecode formst to query their rewrite array.
-     *
-     * Note that this should not be called from bytecodes
-     * which have a static rewrite; use the table in ByteCodeForm
-     * instead to specify those rewrites.
+     * Some bytecodes (the ones with variable lengths) can't have a static
+     * rewrite array - they need the ability to update the array. This method
+     * permits their associated bytecode formst to query their rewrite array.
+     * 
+     * Note that this should not be called from bytecodes which have a static
+     * rewrite; use the table in ByteCodeForm instead to specify those rewrites.
      */
     public int[] getRewrite() {
         return rewrite;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPClass.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPClass.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPClass.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPClass.java Fri Apr 11 03:09:38 2008
@@ -24,61 +24,62 @@
  */
 public class CPClass extends ConstantPoolEntry {
 
-	private int index;
+    private int index;
 
-	public String name;
+    public String name;
 
-	private final CPUTF8 utf8;
+    private final CPUTF8 utf8;
 
-	/**
-	 * Creates a new CPClass
-	 * @param name
-	 * @throws NullPointerException if name is null
-	 */
+    /**
+     * Creates a new CPClass
+     * 
+     * @param name
+     * @throws NullPointerException
+     *             if name is null
+     */
     public CPClass(CPUTF8 name) {
-		super(ConstantPoolEntry.CP_Class);
-		this.name = name.underlyingString();
-		this.domain = ClassConstantPool.DOMAIN_CLASSREF;
-		this.utf8 = name;
-		if(name == null) {
+        super(ConstantPoolEntry.CP_Class);
+        this.name = name.underlyingString();
+        this.domain = ClassConstantPool.DOMAIN_CLASSREF;
+        this.utf8 = name;
+        if (name == null) {
             throw new NullPointerException("Null arguments are not allowed");
-		}
-	}
+        }
+    }
 
     public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-		if (obj == null)
-			return false;
-		if (this.getClass() != obj.getClass())
-			return false;
-		final CPClass other = (CPClass) obj;
-		return utf8.equals(other.utf8);
-	}
-
-	protected ClassFileEntry[] getNestedClassFileEntries() {
-		return new ClassFileEntry[] { utf8, };
-	}
-
-
-	public int hashCode() {
-		return utf8.hashCode();
-	}
-
-	protected void resolve(ClassConstantPool pool) {
-		super.resolve(pool);
-		index = pool.indexOf(utf8);
-	}
-
-	public String toString() {
-		return "Class: " + getName();
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	protected void writeBody(DataOutputStream dos) throws IOException {
-		dos.writeShort(index);
-	}
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (this.getClass() != obj.getClass())
+            return false;
+        final CPClass other = (CPClass) obj;
+        return utf8.equals(other.utf8);
+    }
+
+    protected ClassFileEntry[] getNestedClassFileEntries() {
+        return new ClassFileEntry[] { utf8, };
+    }
+
+    public int hashCode() {
+        return utf8.hashCode();
+    }
+
+    protected void resolve(ClassConstantPool pool) {
+        super.resolve(pool);
+        index = pool.indexOf(utf8);
+    }
+
+    public String toString() {
+        return "Class: " + getName();
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    protected void writeBody(DataOutputStream dos) throws IOException {
+        dos.writeShort(index);
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPConstant.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPConstant.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPConstant.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPConstant.java Fri Apr 11 03:09:38 2008
@@ -22,46 +22,48 @@
  */
 public abstract class CPConstant extends ConstantPoolEntry {
 
-	private final Object value;
+    private final Object value;
 
-	/**
-	 * Create a new CPConstant
-	 * @param tag
-	 * @param value
-	 * @throws NullPointerException if value is null
-	 */
-	public CPConstant(byte tag, Object value) {
-		super(tag);
-		this.value = value;
-		if (value == null) {
-		    throw new NullPointerException("Null arguments are not allowed");
-		}
-	}
+    /**
+     * Create a new CPConstant
+     * 
+     * @param tag
+     * @param value
+     * @throws NullPointerException
+     *             if value is null
+     */
+    public CPConstant(byte tag, Object value) {
+        super(tag);
+        this.value = value;
+        if (value == null) {
+            throw new NullPointerException("Null arguments are not allowed");
+        }
+    }
 
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-		if (obj == null)
-			return false;
-		if (this.getClass() != obj.getClass())
-			return false;
-		final CPConstant other = (CPConstant) obj;
-		if (value == null) {
-			if (other.value != null)
-				return false;
-		} else if (!value.equals(other.value))
-			return false;
-		return true;
-	}
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (this.getClass() != obj.getClass())
+            return false;
+        final CPConstant other = (CPConstant) obj;
+        if (value == null) {
+            if (other.value != null)
+                return false;
+        } else if (!value.equals(other.value))
+            return false;
+        return true;
+    }
 
-	public int hashCode() {
-		final int PRIME = 31;
-		int result = 1;
-		result = PRIME * result + ((value == null) ? 0 : value.hashCode());
-		return result;
-	}
+    public int hashCode() {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result + ((value == null) ? 0 : value.hashCode());
+        return result;
+    }
 
-	protected Object getValue() {
-		return value;
-	}
+    protected Object getValue() {
+        return value;
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPConstantNumber.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPConstantNumber.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPConstantNumber.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPConstantNumber.java Fri Apr 11 03:09:38 2008
@@ -21,13 +21,12 @@
  */
 public abstract class CPConstantNumber extends CPConstant {
 
-	public CPConstantNumber(byte tag, Object value) {
-		super(tag, value);
-	}
-
-	protected Number getNumber() {
-		return (Number)getValue();
-	}
+    public CPConstantNumber(byte tag, Object value) {
+        super(tag, value);
+    }
 
+    protected Number getNumber() {
+        return (Number) getValue();
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPDouble.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPDouble.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPDouble.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPDouble.java Fri Apr 11 03:09:38 2008
@@ -25,16 +25,16 @@
 public class CPDouble extends CPConstantNumber {
 
     public CPDouble(Double value) {
-		super(ConstantPoolEntry.CP_Double,value);
+        super(ConstantPoolEntry.CP_Double, value);
         this.domain = ClassConstantPool.DOMAIN_DOUBLE;
-	}
+    }
 
     protected void writeBody(DataOutputStream dos) throws IOException {
-		dos.writeDouble(getNumber().doubleValue());
-	}
+        dos.writeDouble(getNumber().doubleValue());
+    }
 
-	public String toString() {
-		return "Double: " + getValue();
-	}
+    public String toString() {
+        return "Double: " + getValue();
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPField.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPField.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPField.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPField.java Fri Apr 11 03:09:38 2008
@@ -23,8 +23,8 @@
  */
 public class CPField extends CPMember {
 
-	public CPField(CPUTF8 name, CPUTF8 descriptor, long flags, List attributes) {
-		super(name, descriptor, flags, attributes);
-	}
+    public CPField(CPUTF8 name, CPUTF8 descriptor, long flags, List attributes) {
+        super(name, descriptor, flags, attributes);
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFieldRef.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFieldRef.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFieldRef.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFieldRef.java Fri Apr 11 03:09:38 2008
@@ -24,64 +24,66 @@
  */
 public class CPFieldRef extends ConstantPoolEntry {
 
-	CPClass className;
-	transient int classNameIndex;
-	private final CPNameAndType nameAndType;
-	transient int nameAndTypeIndex;
-
-	public CPFieldRef(CPClass className, CPNameAndType descriptor) {
-		super(ConstantPoolEntry.CP_Fieldref);
-		this.domain = ClassConstantPool.DOMAIN_FIELD;
-		this.className = className;
-		this.nameAndType = descriptor;
-	}
-
-	protected ClassFileEntry[] getNestedClassFileEntries() {
-		return new ClassFileEntry[] {className, nameAndType};
-	}
-
-	protected void resolve(ClassConstantPool pool) {
-		super.resolve(pool);
-		nameAndTypeIndex = pool.indexOf(nameAndType);
-		classNameIndex = pool.indexOf(className);
-	}
-
-	protected void writeBody(DataOutputStream dos) throws IOException {
-		dos.writeShort(classNameIndex);
-		dos.writeShort(nameAndTypeIndex);
-	}
-
-	public String toString() {
-		return "FieldRef: " + className + "#" + nameAndType;
-	}
-
-	public int hashCode() {
-		final int PRIME = 31;
-		int result = 1;
-		result = PRIME * result + ((className == null) ? 0 : className.hashCode());
-		result = PRIME * result + ((nameAndType == null) ? 0 : nameAndType.hashCode());
-		return result;
-	}
-
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-		if (obj == null)
-			return false;
-		if (getClass() != obj.getClass())
-			return false;
-		final CPFieldRef other = (CPFieldRef) obj;
-		if (className == null) {
-			if (other.className != null)
-				return false;
-		} else if (!className.equals(other.className))
-			return false;
-		if (nameAndType == null) {
-			if (other.nameAndType != null)
-				return false;
-		} else if (!nameAndType.equals(other.nameAndType))
-			return false;
-		return true;
-	}
+    CPClass className;
+    transient int classNameIndex;
+    private final CPNameAndType nameAndType;
+    transient int nameAndTypeIndex;
+
+    public CPFieldRef(CPClass className, CPNameAndType descriptor) {
+        super(ConstantPoolEntry.CP_Fieldref);
+        this.domain = ClassConstantPool.DOMAIN_FIELD;
+        this.className = className;
+        this.nameAndType = descriptor;
+    }
+
+    protected ClassFileEntry[] getNestedClassFileEntries() {
+        return new ClassFileEntry[] { className, nameAndType };
+    }
+
+    protected void resolve(ClassConstantPool pool) {
+        super.resolve(pool);
+        nameAndTypeIndex = pool.indexOf(nameAndType);
+        classNameIndex = pool.indexOf(className);
+    }
+
+    protected void writeBody(DataOutputStream dos) throws IOException {
+        dos.writeShort(classNameIndex);
+        dos.writeShort(nameAndTypeIndex);
+    }
+
+    public String toString() {
+        return "FieldRef: " + className + "#" + nameAndType;
+    }
+
+    public int hashCode() {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result
+                + ((className == null) ? 0 : className.hashCode());
+        result = PRIME * result
+                + ((nameAndType == null) ? 0 : nameAndType.hashCode());
+        return result;
+    }
+
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        final CPFieldRef other = (CPFieldRef) obj;
+        if (className == null) {
+            if (other.className != null)
+                return false;
+        } else if (!className.equals(other.className))
+            return false;
+        if (nameAndType == null) {
+            if (other.nameAndType != null)
+                return false;
+        } else if (!nameAndType.equals(other.nameAndType))
+            return false;
+        return true;
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFloat.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFloat.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFloat.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPFloat.java Fri Apr 11 03:09:38 2008
@@ -25,16 +25,16 @@
 public class CPFloat extends CPConstantNumber {
 
     public CPFloat(Float value) {
-		super(ConstantPoolEntry.CP_Float,value);
-	      this.domain = ClassConstantPool.DOMAIN_FLOAT;
-	}
+        super(ConstantPoolEntry.CP_Float, value);
+        this.domain = ClassConstantPool.DOMAIN_FLOAT;
+    }
 
     protected void writeBody(DataOutputStream dos) throws IOException {
-		dos.writeFloat(getNumber().floatValue());
-	}
+        dos.writeFloat(getNumber().floatValue());
+    }
 
-	public String toString() {
-		return "Float: " + getValue();
-	}
+    public String toString() {
+        return "Float: " + getValue();
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPInteger.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPInteger.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPInteger.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPInteger.java Fri Apr 11 03:09:38 2008
@@ -25,17 +25,16 @@
 public class CPInteger extends CPConstantNumber {
 
     public CPInteger(Integer value) {
-		super(ConstantPoolEntry.CP_Integer,value);
-		this.domain = ClassConstantPool.DOMAIN_INTEGER;
-	}
+        super(ConstantPoolEntry.CP_Integer, value);
+        this.domain = ClassConstantPool.DOMAIN_INTEGER;
+    }
 
     protected void writeBody(DataOutputStream dos) throws IOException {
-		dos.writeInt(getNumber().intValue());
-	}
+        dos.writeInt(getNumber().intValue());
+    }
 
-
-	public String toString() {
-		return "Integer: " + getValue();
-	}
+    public String toString() {
+        return "Integer: " + getValue();
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPInterfaceMethodRef.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPInterfaceMethodRef.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPInterfaceMethodRef.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPInterfaceMethodRef.java Fri Apr 11 03:09:38 2008
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 package org.apache.harmony.pack200.bytecode;
 
@@ -21,20 +18,19 @@
  */
 public class CPInterfaceMethodRef extends CPRef {
 
-	public CPInterfaceMethodRef(CPClass className, CPNameAndType descriptor) {
-		super(ConstantPoolEntry.CP_InterfaceMethodref, className, descriptor);
-		this.domain = ClassConstantPool.DOMAIN_METHOD;
-	}
+    public CPInterfaceMethodRef(CPClass className, CPNameAndType descriptor) {
+        super(ConstantPoolEntry.CP_InterfaceMethodref, className, descriptor);
+        this.domain = ClassConstantPool.DOMAIN_METHOD;
+    }
 
-	/**
-	 * This method answers the value this method will use
-	 * for an invokeinterface call. This is equal to 1 + the
-	 * count of all the args, where longs and doubles count for
-	 * 2 and all others count for 1.
-	 *
-	 * @return integer count
-	 */
-	public int invokeInterfaceCount() {
-	    return nameAndType.invokeInterfaceCount();
-	}
+    /**
+     * This method answers the value this method will use for an invokeinterface
+     * call. This is equal to 1 + the count of all the args, where longs and
+     * doubles count for 2 and all others count for 1.
+     * 
+     * @return integer count
+     */
+    public int invokeInterfaceCount() {
+        return nameAndType.invokeInterfaceCount();
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPLong.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPLong.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPLong.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPLong.java Fri Apr 11 03:09:38 2008
@@ -25,17 +25,16 @@
 public class CPLong extends CPConstantNumber {
 
     public CPLong(Long value) {
-		super(ConstantPoolEntry.CP_Long,value);
+        super(ConstantPoolEntry.CP_Long, value);
         this.domain = ClassConstantPool.DOMAIN_LONG;
-	}
+    }
 
     protected void writeBody(DataOutputStream dos) throws IOException {
-		dos.writeLong(getNumber().longValue());
-	}
+        dos.writeLong(getNumber().longValue());
+    }
 
-
-	public String toString() {
-		return "Long: " + getValue();
-	}
+    public String toString() {
+        return "Long: " + getValue();
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPMember.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPMember.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPMember.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPMember.java Fri Apr 11 03:09:38 2008
@@ -27,95 +27,98 @@
  */
 public class CPMember extends ClassFileEntry {
 
-	List attributes;
-	short flags;
-	CPUTF8 name;
-	transient int nameIndex;
-	private final CPUTF8 descriptor;
-	transient int descriptorIndex;
-
-	/**
-	 * Create a new CPMember
-	 * @param name
-	 * @param descriptor
-	 * @param flags
-	 * @param attributes
-	 * @throws NullPointerException if name or descriptor is null
-	 */
-	public CPMember(CPUTF8 name, CPUTF8 descriptor, long flags, List attributes) {
-		this.name = name;
+    List attributes;
+    short flags;
+    CPUTF8 name;
+    transient int nameIndex;
+    private final CPUTF8 descriptor;
+    transient int descriptorIndex;
+
+    /**
+     * Create a new CPMember
+     * 
+     * @param name
+     * @param descriptor
+     * @param flags
+     * @param attributes
+     * @throws NullPointerException
+     *             if name or descriptor is null
+     */
+    public CPMember(CPUTF8 name, CPUTF8 descriptor, long flags, List attributes) {
+        this.name = name;
         this.descriptor = descriptor;
         this.flags = (short) flags;
-		this.attributes = (attributes == null ? Collections.EMPTY_LIST : attributes);
-		if(name == null || descriptor == null) {
+        this.attributes = (attributes == null ? Collections.EMPTY_LIST
+                : attributes);
+        if (name == null || descriptor == null) {
             throw new NullPointerException("Null arguments are not allowed");
-		}
-	}
+        }
+    }
 
-	protected ClassFileEntry[] getNestedClassFileEntries() {
-		int attributeCount = attributes.size();
-		ClassFileEntry[] entries = new ClassFileEntry[attributeCount+2];
-		entries[0] = name;
-		entries[1] = descriptor;
-		for (int i = 0; i < attributeCount; i++) {
-			entries[i+2] = (Attribute) attributes.get(i);
-		}
-		return entries;
-	}
-
-	protected void resolve(ClassConstantPool pool) {
-		super.resolve(pool);
-		nameIndex = pool.indexOf(name);
-		descriptorIndex = pool.indexOf(descriptor);
-		for (Iterator it = attributes.iterator(); it.hasNext();) {
-			Attribute attribute = (Attribute) it.next();
-			attribute.resolve(pool);
-		}
-	}
-
-	public String toString() {
-		return "Field: " + name + "(" + descriptor + ")";
-	}
-
-	public int hashCode() {
-		final int PRIME = 31;
-		int result = 1;
-		result = PRIME * result + attributes.hashCode();
-		result = PRIME * result + descriptor.hashCode();
-		result = PRIME * result + flags;
-		result = PRIME * result + name.hashCode();
-		return result;
-	}
-
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-		if (obj == null)
-			return false;
-		if (getClass() != obj.getClass())
-			return false;
-		final CPMember other = (CPMember) obj;
-		if (!attributes.equals(other.attributes))
-			return false;
-		if (!descriptor.equals(other.descriptor))
-			return false;
-		if (flags != other.flags)
-			return false;
-		if (!name.equals(other.name))
-			return false;
-		return true;
-	}
-
-	protected void doWrite(DataOutputStream dos) throws IOException {
-		dos.writeShort(flags);
-		dos.writeShort(nameIndex);
-		dos.writeShort(descriptorIndex);
-    	int attributeCount = attributes.size();
-		dos.writeShort(attributeCount);
-		for (int i = 0; i < attributeCount; i++) {
-			Attribute attribute = (Attribute) attributes.get(i);
-			attribute.doWrite(dos);
-		}
-	}
+    protected ClassFileEntry[] getNestedClassFileEntries() {
+        int attributeCount = attributes.size();
+        ClassFileEntry[] entries = new ClassFileEntry[attributeCount + 2];
+        entries[0] = name;
+        entries[1] = descriptor;
+        for (int i = 0; i < attributeCount; i++) {
+            entries[i + 2] = (Attribute) attributes.get(i);
+        }
+        return entries;
+    }
+
+    protected void resolve(ClassConstantPool pool) {
+        super.resolve(pool);
+        nameIndex = pool.indexOf(name);
+        descriptorIndex = pool.indexOf(descriptor);
+        for (Iterator it = attributes.iterator(); it.hasNext();) {
+            Attribute attribute = (Attribute) it.next();
+            attribute.resolve(pool);
+        }
+    }
+
+    public String toString() {
+        return "Field: " + name + "(" + descriptor + ")";
+    }
+
+    public int hashCode() {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result + attributes.hashCode();
+        result = PRIME * result + descriptor.hashCode();
+        result = PRIME * result + flags;
+        result = PRIME * result + name.hashCode();
+        return result;
+    }
+
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        final CPMember other = (CPMember) obj;
+        if (!attributes.equals(other.attributes))
+            return false;
+        if (!descriptor.equals(other.descriptor))
+            return false;
+        if (flags != other.flags)
+            return false;
+        if (!name.equals(other.name))
+            return false;
+        return true;
+    }
+
+    protected void doWrite(DataOutputStream dos) throws IOException {
+        dos.writeShort(flags);
+        dos.writeShort(nameIndex);
+        dos.writeShort(descriptorIndex);
+        int attributeCount = attributes.size();
+        dos.writeShort(attributeCount);
+        for (int i = 0; i < attributeCount; i++) {
+            Attribute attribute = (Attribute) attributes.get(i);
+            attribute.doWrite(dos);
+        }
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPMethod.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPMethod.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPMethod.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPMethod.java Fri Apr 11 03:09:38 2008
@@ -23,8 +23,8 @@
  */
 public class CPMethod extends CPMember {
 
-	public CPMethod(CPUTF8 name, CPUTF8 descriptor, long flags, List attributes) {
-		super(name, descriptor, flags, attributes);
-	}
+    public CPMethod(CPUTF8 name, CPUTF8 descriptor, long flags, List attributes) {
+        super(name, descriptor, flags, attributes);
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPMethodRef.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPMethodRef.java?rev=647100&r1=647099&r2=647100&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPMethodRef.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/CPMethodRef.java Fri Apr 11 03:09:38 2008
@@ -21,13 +21,13 @@
  */
 public class CPMethodRef extends CPRef {
 
-	public CPMethodRef(CPClass className, CPNameAndType descriptor) {
-		super(ConstantPoolEntry.CP_Methodref, className, descriptor);
+    public CPMethodRef(CPClass className, CPNameAndType descriptor) {
+        super(ConstantPoolEntry.CP_Methodref, className, descriptor);
         this.domain = ClassConstantPool.DOMAIN_METHOD;
-	}
+    }
 
-	protected ClassFileEntry[] getNestedClassFileEntries() {
-		return new ClassFileEntry[] { className, nameAndType };
-	}
+    protected ClassFileEntry[] getNestedClassFileEntries() {
+        return new ClassFileEntry[] { className, nameAndType };
+    }
 
 }



Mime
View raw message