GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-560

Groovy script launcher not behaving quite right

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.0m1
    • Fix Version/s: 2.0.0m2
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Define a groovy project.

      Create this java type MyHelper.java:

      import groovy.lang.Closure;

      public class MyHelper {

      public void someMethod(int i,Closure c) {
      for (int j=0;j<i;j++)

      { c.call(j); }

      }
      }

      Define a script demoscript.groovy:

      mh =new MyHelper()

      mh.someMethod(4) {
      println "$

      {it}

      "
      }

      In the script editor window, RunAs>JavaApplication - works
      RunAs>GroovyScript:
      Caught: groovy.lang.MissingMethodException: No signature of method: MyHelper.someMethod() is applicable for argument types: (java.lang.Integer, demoscript$_run_closure1) values: [4, demoscript$_run_closure1@16d835f]
      Possible solutions: someMethod(int, groovy.lang.Closure)
      at demoscript.run(demoscript.groovy:3)

      it is as if the classpath for the script launch is not including the path to the compiled MyHelper, however, there must be slightly more to it because it doesn't complain it can't find MyHelper, it complains it can't find the method within MyHelper.

        Activity

        Andrew Eisenberg made changes -
        Field Original Value New Value
        Assignee Andrew Eisenberg [ werdna ]
        Andrew Eisenberg made changes -
        Original Estimate 0 minutes [ 0 ]
        Remaining Estimate 0 minutes [ 0 ]
        Andrew Eisenberg made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Andrew Eisenberg made changes -
        Component/s Run/Debug [ 13153 ]

          People

          • Assignee:
            Andrew Eisenberg
            Reporter:
            Andy Clement
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: