diff options
author | Andy Clement <aclement@pivotal.io> | 2018-02-07 12:38:52 -0800 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2018-02-07 12:38:52 -0800 |
commit | 19cfe0e1caa611180f3513400c31507ad924cae6 (patch) | |
tree | 3e447fce9bab7f87a4451659b781ac6beadb8268 /bcel-builder/src | |
parent | 031b2ed1aae5d49a3b9a393a3d0dcc01b2bbe34a (diff) | |
download | aspectj-19cfe0e1caa611180f3513400c31507ad924cae6.tar.gz aspectj-19cfe0e1caa611180f3513400c31507ad924cae6.zip |
Add missing cases to bcel constantToString
Diffstat (limited to 'bcel-builder/src')
-rw-r--r-- | bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantPool.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantPool.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantPool.java index be5b84564..0430e28ba 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantPool.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantPool.java @@ -207,6 +207,26 @@ public class ConstantPool implements Node { str = (constantToString(((ConstantCP) c).getClassIndex(), Constants.CONSTANT_Class) + "." + constantToString( ((ConstantCP) c).getNameAndTypeIndex(), Constants.CONSTANT_NameAndType)); break; + + case Constants.CONSTANT_InvokeDynamic: + ConstantInvokeDynamic cID = ((ConstantInvokeDynamic)c); + return "#"+cID.getBootstrapMethodAttrIndex()+"."+constantToString(cID.getNameAndTypeIndex(), Constants.CONSTANT_NameAndType); + + case Constants.CONSTANT_MethodHandle: + ConstantMethodHandle cMH = ((ConstantMethodHandle)c); + return cMH.getReferenceKind()+":"+constantToString(cMH.getReferenceIndex(),Constants.CONSTANT_Methodref); + + case Constants.CONSTANT_MethodType: + ConstantMethodType cMT = (ConstantMethodType)c; + return constantToString(cMT.getDescriptorIndex(),Constants.CONSTANT_Utf8); + + case Constants.CONSTANT_Module: + ConstantModule cM = (ConstantModule)c; + return "Module:"+constantToString(cM.getNameIndex(),Constants.CONSTANT_Utf8); + + case Constants.CONSTANT_Package: + ConstantPackage cP = (ConstantPackage)c; + return "Package:"+constantToString(cP.getNameIndex(),Constants.CONSTANT_Utf8); default: // Never reached throw new RuntimeException("Unknown constant type " + c.tag); @@ -254,6 +274,7 @@ public class ConstantPool implements Node { return constantToString(getConstant(index)); } + @Override public void accept(ClassVisitor v) { v.visitConstantPool(this); } |