diff options
author | aclement <aclement> | 2006-09-22 10:50:07 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-09-22 10:50:07 +0000 |
commit | 497a8095510715712b98ee41bbdd825bf9fde9d7 (patch) | |
tree | a7f1626654e5692934568e5f358fa9aabcd63a2e | |
parent | 98a5d925536b291ca760ca510a2e06b7e3cff13e (diff) | |
download | aspectj-497a8095510715712b98ee41bbdd825bf9fde9d7.tar.gz aspectj-497a8095510715712b98ee41bbdd825bf9fde9d7.zip |
154054 testcode and fix: noticing changes in around advice and forcing full builds: bcel changed to offer pretty string for code elements
-rw-r--r-- | bcel-builder/src/org/aspectj/apache/bcel/classfile/Code.java | 27 | ||||
-rw-r--r-- | lib/bcel/bcel-src.zip | bin | 879933 -> 880253 bytes | |||
-rw-r--r-- | lib/bcel/bcel.jar | bin | 610339 -> 610708 bytes |
3 files changed, 26 insertions, 1 deletions
diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/Code.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/Code.java index 7ace85a59..235f73c1e 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/Code.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/Code.java @@ -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(); + } } diff --git a/lib/bcel/bcel-src.zip b/lib/bcel/bcel-src.zip Binary files differindex de585c8e5..0874f3767 100644 --- a/lib/bcel/bcel-src.zip +++ b/lib/bcel/bcel-src.zip diff --git a/lib/bcel/bcel.jar b/lib/bcel/bcel.jar Binary files differindex 6841232ce..b07a9820d 100644 --- a/lib/bcel/bcel.jar +++ b/lib/bcel/bcel.jar |