0

Java file :

      public class TestModule{

          @WrapToScript
          public Integer test() final Object params) {
              return 10;
          }
      }

I will include the above class into the ease module using extension point as follows:

      <extension
         point="org.eclipse.ease.modules">

      <module
            category="pkg.script.platform"
            class="pkg.script.modules.TestModule"
            id="pkg.script.modules.TestModule"
            name="TestModule"
            visible="true">
      </module>
   </extension>

Groovy script:

      print(test();)

I am calling the java module loaded from groovy, if i write some functionality inside that test() method it works fine, but it returns Null always, even if I return some integer explicitly. Expected output for this script is 10, but it prints null.

Indent
  • 4,675
  • 1
  • 19
  • 35
Subitsha
  • 1
  • 1
  • when java function is called from groovy script engine, it returns null, instead of integer..., for some modules the return code is proper, but for few function it works like this. – Subitsha Nov 09 '17 at 03:46

1 Answers1

0

It happened because of the pre and post execution code added to the Module i have created while initializing the engine.

In the post execution code we had an variable called result, and groovy engine stores its result also in the same name.

So the result variable was rewritten in the post execution code.

Once renaming the variable name in the post execution code the issue is resolved.

Subitsha
  • 1
  • 1