]> source.dussan.org Git - aspectj.git/commitdiff
154054 testcode and fix: noticing changes in around advice and forcing full builds...
authoraclement <aclement>
Fri, 22 Sep 2006 10:50:07 +0000 (10:50 +0000)
committeraclement <aclement>
Fri, 22 Sep 2006 10:50:07 +0000 (10:50 +0000)
bcel-builder/src/org/aspectj/apache/bcel/classfile/Code.java
lib/bcel/bcel-src.zip
lib/bcel/bcel.jar

index 7ace85a5951854c0287e4535d78b3162c528aaa1..235f73c1e64375fe82f435a4177f82e68a09426f 100644 (file)
@@ -69,7 +69,7 @@ import  java.io.*;
  * is used for debugging purposes and <em>LocalVariableTable</em> which 
  * contains information about the local variables.
  *
- * @version $Id: Code.java,v 1.2 2004/11/19 16:45:18 aclement Exp $
+ * @version $Id: Code.java,v 1.3 2006/09/22 10:50:17 aclement Exp $
  * @author  <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
  * @see     Attribute
  * @see     CodeException
@@ -370,4 +370,29 @@ public final class Code extends Attribute {
 
     return c;
   }
+  
+  /**
+   * Returns the same as toString(true) except that the attribute information
+   * isn't included (line numbers).
+   * Can be used to check whether two pieces of code are equivalent.
+   */
+  public String getCodeString() {
+         StringBuffer codeString = new StringBuffer();
+         codeString.append("Code(max_stack = ").append(max_stack);
+         codeString.append(", max_locals = ").append(max_locals);
+         codeString.append(", code_length = ").append(code_length).append(")\n");
+         codeString.append(Utility.codeToString(code, constant_pool, 0, -1,true));
+         if (exception_table_length>0) {
+                 codeString.append("\n").append("Exception entries =  ").append(exception_table_length).append("\n");
+                 for (int i = 0; i < exception_table_length; i++) {
+                       CodeException exc = exception_table[i];
+                       int type = exc.getCatchType();
+                       String name = "finally";
+                       if (type!=0) name = this.constant_pool.getConstantString(type,Constants.CONSTANT_Class);
+                       codeString.append(name).append("[");
+                       codeString.append(exc.getStartPC()).append(">").append(exc.getEndPC()).append("]\n");
+                 }
+         }
+         return codeString.toString();
+  }
 }
index de585c8e58243b8551b7f21c619dde1e7e2e61be..0874f3767a6514305203e7849add8d3f89e054f6 100644 (file)
Binary files a/lib/bcel/bcel-src.zip and b/lib/bcel/bcel-src.zip differ
index 6841232ce75b70fac524f2a72d1af5ac9eaf9cbc..b07a9820df7125cedbbba2ceaab472fae855ffc9 100644 (file)
Binary files a/lib/bcel/bcel.jar and b/lib/bcel/bcel.jar differ