Skip to content

Commit

Permalink
Jira Issue #284 Handle InvokeDynamic.getReferenceType() sanely
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/bcel/trunk@1773000 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mebigfatguy committed Dec 7, 2016
1 parent 1aa8cc0 commit 28d51da
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main/java/org/apache/bcel/generic/INVOKEDYNAMIC.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,18 @@ public String getClassName( final ConstantPoolGen cpg ) {
final ConstantInvokeDynamic cid = (ConstantInvokeDynamic) cp.getConstant(super.getIndex(), Const.CONSTANT_InvokeDynamic);
return ((ConstantNameAndType) cp.getConstant(cid.getNameAndTypeIndex())).getName(cp);
}


/**
* Since InvokeDynamic doesn't refer to a reference type, just return java.lang.Object,
* as that is the only type we can say for sure the reference will be.
*
* @param cpg
* the ConstantPoolGen used to create the instruction
* @return an ObjectType for java.lang.Object
*/
@Override
public ReferenceType getReferenceType(final ConstantPoolGen cpg) {
return new ObjectType(Object.class.getName());
}
}

0 comments on commit 28d51da

Please sign in to comment.