浏览代码

154054 testcode and fix: noticing changes in around advice and forcing full builds: bcel changed to offer pretty string for code elements

tags/BEFORE_133532
aclement 17 年前
父节点
当前提交
497a809551
共有 3 个文件被更改,包括 26 次插入1 次删除
  1. 26
    1
      bcel-builder/src/org/aspectj/apache/bcel/classfile/Code.java
  2. 二进制
      lib/bcel/bcel-src.zip
  3. 二进制
      lib/bcel/bcel.jar

+ 26
- 1
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();
}
}

二进制
lib/bcel/bcel-src.zip 查看文件


二进制
lib/bcel/bcel.jar 查看文件


正在加载...
取消
保存