From 1c0f36ea2026aff22afd9c9d22782db8233c8b95 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Mon, 19 Mar 2012 12:16:10 -0700 Subject: call jps and indy --- .../org/aspectj/apache/bcel/generic/FieldOrMethod.java | 2 +- .../org/aspectj/apache/bcel/generic/InvokeDynamic.java | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'bcel-builder') diff --git a/bcel-builder/src/org/aspectj/apache/bcel/generic/FieldOrMethod.java b/bcel-builder/src/org/aspectj/apache/bcel/generic/FieldOrMethod.java index 4987969c3..44b263ffb 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/generic/FieldOrMethod.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/generic/FieldOrMethod.java @@ -68,7 +68,7 @@ import org.aspectj.apache.bcel.classfile.ConstantUtf8; public abstract class FieldOrMethod extends InstructionCP { protected String signature; - private String name; + protected String name; private String classname; protected FieldOrMethod(short opcode, int index) { diff --git a/bcel-builder/src/org/aspectj/apache/bcel/generic/InvokeDynamic.java b/bcel-builder/src/org/aspectj/apache/bcel/generic/InvokeDynamic.java index 7083500d0..951f9b1b3 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/generic/InvokeDynamic.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/generic/InvokeDynamic.java @@ -58,6 +58,7 @@ import java.io.DataOutputStream; import java.io.IOException; import org.aspectj.apache.bcel.Constants; +import org.aspectj.apache.bcel.classfile.ConstantCP; import org.aspectj.apache.bcel.classfile.ConstantInvokeDynamic; import org.aspectj.apache.bcel.classfile.ConstantNameAndType; import org.aspectj.apache.bcel.classfile.ConstantPool; @@ -108,9 +109,23 @@ public final class InvokeDynamic extends InvokeInstruction { if (signature == null) { ConstantInvokeDynamic cid = (ConstantInvokeDynamic)cp.getConstant(index); ConstantNameAndType cnat = (ConstantNameAndType) cp.getConstant(cid.getNameAndTypeIndex()); - signature = ((ConstantUtf8) cp.getConstant(cnat.getSignatureIndex())).getValue(); + signature = cp.getConstantUtf8(cnat.getSignatureIndex()).getValue(); } return signature; } + + @Override + public String getName(ConstantPool cp) { + if (name == null) { + ConstantInvokeDynamic cid = (ConstantInvokeDynamic) cp.getConstant(index); + ConstantNameAndType cnat = (ConstantNameAndType) cp.getConstant(cid.getNameAndTypeIndex()); + name = cp.getConstantUtf8(cnat.getNameIndex()).getValue(); + } + return name; + } + + public String getClassName(ConstantPool cp) { + throw new IllegalStateException("nyi"); + } } -- cgit v1.2.3