From: aclement Date: Fri, 22 Sep 2006 10:50:07 +0000 (+0000) Subject: 154054 testcode and fix: noticing changes in around advice and forcing full builds... X-Git-Tag: BEFORE_133532~40 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=497a8095510715712b98ee41bbdd825bf9fde9d7;p=aspectj.git 154054 testcode and fix: noticing changes in around advice and forcing full builds: bcel changed to offer pretty string for code elements --- 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 LocalVariableTable 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 M. Dahm * @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 index de585c8e5..0874f3767 100644 Binary files a/lib/bcel/bcel-src.zip and b/lib/bcel/bcel-src.zip differ diff --git a/lib/bcel/bcel.jar b/lib/bcel/bcel.jar index 6841232ce..b07a9820d 100644 Binary files a/lib/bcel/bcel.jar and b/lib/bcel/bcel.jar differ