Skip to content

Commit cd4c548

Browse files
Fix: ConstantMethodref only is too narrow.
Generalize from ConstantMethodref to ConstantCP to cover also ConstantInterfaceMethodref and possibly others.
1 parent 3249600 commit cd4c548

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/gr/gousiosg/javacg/stat/DynamicCallManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import org.apache.bcel.classfile.Attribute;
99
import org.apache.bcel.classfile.BootstrapMethod;
1010
import org.apache.bcel.classfile.BootstrapMethods;
11+
import org.apache.bcel.classfile.ConstantCP;
1112
import org.apache.bcel.classfile.ConstantMethodHandle;
12-
import org.apache.bcel.classfile.ConstantMethodref;
1313
import org.apache.bcel.classfile.ConstantNameAndType;
1414
import org.apache.bcel.classfile.ConstantPool;
1515
import org.apache.bcel.classfile.ConstantUtf8;
@@ -80,7 +80,7 @@ public void retrieveCalls(Method method, JavaClass jc) {
8080

8181
private String getMethodNameFromHandleIndex(ConstantPool cp, int callIndex) {
8282
ConstantMethodHandle handle = (ConstantMethodHandle) cp.getConstant(callIndex);
83-
ConstantMethodref ref = (ConstantMethodref) cp.getConstant(handle.getReferenceIndex());
83+
ConstantCP ref = (ConstantCP) cp.getConstant(handle.getReferenceIndex());
8484
ConstantNameAndType nameAndType = (ConstantNameAndType) cp.getConstant(ref.getNameAndTypeIndex());
8585
return nameAndType.getName(cp);
8686
}

0 commit comments

Comments
 (0)