Adding Methods To TeamManager [message #1769392] |
Mon, 31 July 2017 09:58 |
|
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 10:01] Report message to a moderator
|
|
|
|
|
|
Re: Adding Methods To TeamManager [message #1773840 is a reply to message #1769625] |
Thu, 05 October 2017 12:19 |
|
Okay, I hijack my own thread now :-D
I also made changes to the Object Teams compiler in the plugin org.eclipse.jdt.core. If I export the jars I can run the modified version externally.
But I cannot use the modified version of the compiler currently when running the tests. I did not see, where it takes the compiler from. I even changed the version number in the jdt.core plugin and increased the minimum version for that plugin in the test plugin. Still does not work.
Any suggestions? Thanks for your help :-)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04923 seconds