aboutsummaryrefslogtreecommitdiffstats
path: root/bcel-builder/src
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2017-09-26 07:43:22 -0700
committerAndy Clement <aclement@pivotal.io>2017-09-26 07:43:22 -0700
commit5b36d19d18b61ffbf8400deb36e3098e50910cdb (patch)
tree11090c962354c8aaa53adafedc35096b8f945002 /bcel-builder/src
parenta79709a8d52f49c93b0b7ab18c0a4fe84087bf50 (diff)
downloadaspectj-5b36d19d18b61ffbf8400deb36e3098e50910cdb.tar.gz
aspectj-5b36d19d18b61ffbf8400deb36e3098e50910cdb.zip
Ensure interfacemethodref can be built for invokestatic calls on interface methods
Diffstat (limited to 'bcel-builder/src')
-rw-r--r--bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionFactory.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionFactory.java b/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionFactory.java
index 4ff25bd55..c5db1904a 100644
--- a/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionFactory.java
+++ b/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionFactory.java
@@ -82,6 +82,10 @@ public class InstructionFactory implements InstructionConstants {
this(null, cp);
}
+ public InvokeInstruction createInvoke(String class_name, String name, Type ret_type, Type[] arg_types, short kind) {
+ return createInvoke(class_name, name, ret_type, arg_types, kind, false);
+ }
+
/**
* Create an invoke instruction.
*
@@ -90,14 +94,15 @@ public class InstructionFactory implements InstructionConstants {
* @param ret_type return type of method
* @param arg_types argument types of method
* @param kind how to invoke, i.e., INVOKEINTERFACE, INVOKESTATIC, INVOKEVIRTUAL, or INVOKESPECIAL
+ * @param isInterface for an invokestatic on an interface allows us to tell this method the target is an interface
* @see Constants
*/
- public InvokeInstruction createInvoke(String class_name, String name, Type ret_type, Type[] arg_types, short kind) {
+ public InvokeInstruction createInvoke(String class_name, String name, Type ret_type, Type[] arg_types, short kind, boolean isInterface) {
String signature = Utility.toMethodSignature(ret_type, arg_types);
int index;
- if (kind == Constants.INVOKEINTERFACE) {
+ if (kind == Constants.INVOKEINTERFACE || isInterface) {
index = cp.addInterfaceMethodref(class_name, name, signature);
} else if (kind == Constants.INVOKEDYNAMIC){
throw new IllegalStateException("NYI");