]> source.dussan.org Git - aspectj.git/commitdiff
chewed by formatter
authoraclement <aclement>
Thu, 28 Aug 2008 00:05:29 +0000 (00:05 +0000)
committeraclement <aclement>
Thu, 28 Aug 2008 00:05:29 +0000 (00:05 +0000)
bcel-builder/src/org/aspectj/apache/bcel/generic/LOOKUPSWITCH.java
bcel-builder/src/org/aspectj/apache/bcel/generic/TABLESWITCH.java

index 889bbbc6d29692c06edb77cdcba89daff0e6ee68..b04921ddb69cd08026b7e5eaa60020278c03af0c 100644 (file)
@@ -53,63 +53,63 @@ package org.aspectj.apache.bcel.generic;
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
  */
-import java.io.*;
+import java.io.DataOutputStream;
+import java.io.IOException;
 
 import org.aspectj.apache.bcel.Constants;
 import org.aspectj.apache.bcel.util.ByteSequence;
 
-/** 
+import com.sun.org.apache.bcel.internal.generic.SWITCH;
+
+/**
  * LOOKUPSWITCH - Switch with unordered set of values
- *
- * @version $Id: LOOKUPSWITCH.java,v 1.3 2008/05/28 23:52:57 aclement Exp $
- * @author  <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
+ * 
+ * @version $Id: LOOKUPSWITCH.java,v 1.4 2008/08/28 00:05:29 aclement Exp $
+ * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
  * @see SWITCH
  */
 public class LOOKUPSWITCH extends InstructionSelect {
 
+       public LOOKUPSWITCH(int[] match, InstructionHandle[] targets, InstructionHandle target) {
+               super(LOOKUPSWITCH, match, targets, target);
+               // Alignment remainer assumed 0 here, until dump time
+               length = (short) (9 + matchLength * 8);
+               fixedLength = length;
+       }
 
-  public LOOKUPSWITCH(int[] match, InstructionHandle[] targets,
-                     InstructionHandle target) {
-    super(org.aspectj.apache.bcel.Constants.LOOKUPSWITCH, match, targets, target);
-    
-    length = (short)(9 + matchLength * 8); /* alignment remainder assumed
-                                            * 0 here, until dump time. */
-    fixedLength = length;
-  }
+       /**
+        * Dump instruction as byte code to stream out.
+        * 
+        * @param out Output stream
+        */
+       public void dump(DataOutputStream out) throws IOException {
+               super.dump(out);
+               out.writeInt(matchLength); // npairs
 
-  /**
-   * Dump instruction as byte code to stream out.
-   * @param out Output stream
-   */
-  public void dump(DataOutputStream out) throws IOException {
-    super.dump(out);
-    out.writeInt(matchLength);       // npairs
+               for (int i = 0; i < matchLength; i++) {
+                       out.writeInt(match[i]); // match-offset pairs
+                       out.writeInt(indices[i] = getTargetOffset(targets[i]));
+               }
+       }
 
-    for(int i=0; i < matchLength; i++) {
-      out.writeInt(match[i]);         // match-offset pairs
-      out.writeInt(indices[i] = getTargetOffset(targets[i]));
-    }
-  }
+       /**
+        * Read needed data (e.g. index) from file.
+        */
+       public LOOKUPSWITCH(ByteSequence bytes) throws IOException {
+               super(Constants.LOOKUPSWITCH, bytes); // reads padding
 
-  /**
-   * Read needed data (e.g. index) from file.
-   */
-  public LOOKUPSWITCH(ByteSequence bytes) throws IOException
-  {
-    super(Constants.LOOKUPSWITCH,bytes); // reads padding
+               matchLength = bytes.readInt();
+               fixedLength = (short) (9 + matchLength * 8);
+               length = (short) (fixedLength + padding);
 
-    matchLength = bytes.readInt();
-    fixedLength = (short)(9 + matchLength * 8);
-    length       = (short)(fixedLength + padding);
-         
-    match   = new int[matchLength];
-    indices = new int[matchLength];
-    targets = new InstructionHandle[matchLength];
+               match = new int[matchLength];
+               indices = new int[matchLength];
+               targets = new InstructionHandle[matchLength];
 
-    for(int i=0; i < matchLength; i++) {
-      match[i]   = bytes.readInt();
-      indices[i] = bytes.readInt();
-    }
-  }
+               for (int i = 0; i < matchLength; i++) {
+                       match[i] = bytes.readInt();
+                       indices[i] = bytes.readInt();
+               }
+       }
 
 }
index 9769db4b029b09afc09730c7dfc7e57fd0b25b4b..5dc26346b1a59f119e80aec392a3785884851a33 100644 (file)
@@ -1,5 +1,3 @@
-package org.aspectj.apache.bcel.generic;
-
 /* ====================================================================
  * The Apache Software License, Version 1.1
  *
@@ -53,84 +51,88 @@ package org.aspectj.apache.bcel.generic;
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
  */
-import java.io.*;
+package org.aspectj.apache.bcel.generic;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
 
 import org.aspectj.apache.bcel.Constants;
 import org.aspectj.apache.bcel.util.ByteSequence;
 
-/** 
+import com.sun.org.apache.bcel.internal.generic.SWITCH;
+
+/**
  * TABLESWITCH - Switch within given range of values, i.e., low..high
- *
- * @version $Id: TABLESWITCH.java,v 1.4 2008/05/28 23:52:54 aclement Exp $
- * @author  <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
+ * 
+ * @version $Id: TABLESWITCH.java,v 1.5 2008/08/28 00:05:29 aclement Exp $
+ * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
  * @see SWITCH
  */
 public class TABLESWITCH extends InstructionSelect {
 
-
-  /**
-   * @param match sorted array of match values, match[0] must be low value, 
-   * match[match_length - 1] high value
-   * @param targets where to branch for matched values
-   * @param target default branch
-   */
-  public TABLESWITCH(int[] match, InstructionHandle[] targets,
-                    InstructionHandle target) {
-    super(org.aspectj.apache.bcel.Constants.TABLESWITCH, match, targets, target);
-    
-//    if (match_length==0) {
-//     throw new RuntimeException("A tableswitch with no targets should be represented as a LOOKUPSWITCH");
-//    }
-    
-    length = (short)(13 + matchLength * 4); /* Alignment remainder assumed
-                                             * 0 here, until dump time */
-    fixedLength = length;
-  }
-
-  /**
-   * Dump instruction as byte code to stream out.
-   * @param out Output stream
-   */
-  public void dump(DataOutputStream out) throws IOException {
-    super.dump(out);
-
-    int low = (matchLength > 0)? match[0] : 0;
-    out.writeInt(low);
-
-    int high = (matchLength > 0)? match[matchLength - 1] : 0;
-    out.writeInt(high);
-
-//  See aj bug pr104720
-//    if (match_length==0) out.writeInt(0); // following the switch you need to supply "HIGH-LOW+1" entries
-    
-    for(int i=0; i < matchLength; i++)     // jump offsets
-      out.writeInt(indices[i] = getTargetOffset(targets[i]));
-  }
-
-  /**
-   * Read needed data (e.g. index) from file.
-   */
-  public TABLESWITCH(ByteSequence bytes) throws IOException
-  {
-    super(Constants.TABLESWITCH,bytes);
-
-    int low    = bytes.readInt();
-    int high   = bytes.readInt();
-
-    matchLength = high - low + 1;
-    fixedLength = (short)(13 + matchLength * 4);
-    length       = (short)(fixedLength + padding);
-
-    match   = new int[matchLength];
-    indices = new int[matchLength];
-    targets = new InstructionHandle[matchLength];
-
-    for(int i=low; i <= high; i++)
-      match[i - low] = i;
-
-    for(int i=0; i < matchLength; i++) {
-      indices[i] = bytes.readInt();
-    }
-  }
+       /**
+        * @param match sorted array of match values, match[0] must be low value, match[match_length - 1] high value
+        * @param targets where to branch for matched values
+        * @param target default branch
+        */
+       public TABLESWITCH(int[] match, InstructionHandle[] targets, InstructionHandle target) {
+               super(org.aspectj.apache.bcel.Constants.TABLESWITCH, match, targets, target);
+
+               // if (match_length==0) {
+               // throw new RuntimeException("A tableswitch with no targets should be represented as a LOOKUPSWITCH");
+               // }
+
+               // Alignment remainder assumed 0 here, until dump time
+               length = (short) (13 + matchLength * 4);
+               fixedLength = length;
+       }
+
+       /**
+        * Dump instruction as byte code to stream out.
+        * 
+        * @param out Output stream
+        */
+       public void dump(DataOutputStream out) throws IOException {
+               super.dump(out);
+
+               int low = matchLength > 0 ? match[0] : 0;
+               out.writeInt(low);
+
+               int high = matchLength > 0 ? match[matchLength - 1] : 0;
+               out.writeInt(high);
+
+               // See aj bug pr104720
+               // if (match_length==0) out.writeInt(0); // following the switch you need to supply "HIGH-LOW+1" entries
+
+               for (int i = 0; i < matchLength; i++) {
+                       out.writeInt(indices[i] = getTargetOffset(targets[i]));
+               }
+       }
+
+       /**
+        * Read needed data (e.g. index) from file.
+        */
+       public TABLESWITCH(ByteSequence bytes) throws IOException {
+               super(Constants.TABLESWITCH, bytes);
+
+               int low = bytes.readInt();
+               int high = bytes.readInt();
+
+               matchLength = high - low + 1;
+               fixedLength = (short) (13 + matchLength * 4);
+               length = (short) (fixedLength + padding);
+
+               match = new int[matchLength];
+               indices = new int[matchLength];
+               targets = new InstructionHandle[matchLength];
+
+               for (int i = low; i <= high; i++) {
+                       match[i - low] = i;
+               }
+
+               for (int i = 0; i < matchLength; i++) {
+                       indices[i] = bytes.readInt();
+               }
+       }
 
 }