Adding Methods To TeamManager [message #1769392] |
Mon, 31 July 2017 05:58  |
Eclipse User |
|
|
|
Hi,
I am a bit puzzled about what I experience. I added new static methods to TeamManager. But when I add ASM code to call them from CreateDispatchInCallAllBindingsAdapter I get some tests fail with NoSuchMethodError.
ava.lang.NoSuchMethodError: org.eclipse.objectteams.otredyn.runtime.TeamManager.getTest()V
These tests have callout bindings with either before/replace/after modifier.
The code modification in CreateDispatchInCallAllBindingsAdapter
if(indy) {
instructions.add(new InvokeDynamicInsnNode(ConstantMembers.callAllBindingsTeam.getName(),
ConstantMembers.callAllBindingsTeam.getSignature(), ConstantMembers.callAllBindingsBootstrap));
} else {
instructions.add(new MethodInsnNode(Opcodes.INVOKEINTERFACE,
ClassNames.ITEAM_SLASH,
ConstantMembers.callAllBindingsTeam.getName(),
ConstantMembers.callAllBindingsTeam.getSignature(),
true));
instructions.add(new MethodInsnNode(Opcodes.INVOKESTATIC, ClassNames.TEAM_MANAGER_SLASH,
ConstantMembers.getTest.getName(), ConstantMembers.getTest.getSignature(), false));
}
And I defined it in the ConstantMembers as following:
public static final Method getTest = new Method("getTest", Types
.getTypeStringForMethod(Types.VOID, new String[] {}));
and it is implemented in TeamManager
public static void getTest () { System.out.println("works");}
The only reason I can imagine is that the IDE does not take the version that is built in my IDE. I did now increased the version numbers of required plugins (for ot.equinox since it re-exports runtime) but this does not help.
When calling the tests (otdt.tests.otjld.AllTests.java) from within the IDE as JUnit Plugin Tests does the IDE take the installed ObjectTeams Plugin or does it take the last built version which is under change?
I experience it with invokestatic as well as with the invokedynamic instruction. Method descriptor and everything matches.
Thanks for sharing your experience.
[Updated on: Mon, 31 July 2017 06:01] by Moderator
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04320 seconds