Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-4907

Command line interface of AstNodeToScriptAdapter.groovy don't works

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.8.1, 1.7.11
    • None
    • None
    • Patch

    Description

      I tried AstNodeToScriptAdapter#main() but get

      $ groovy -e 'groovy.inspect.swingui.AstNodeToScriptAdapter.main(args)' a.groovy  1
      Caught: groovy.lang.MissingMethodException: No signature of method: static org.codehaus.groovy.control.CompilePhase.fromPhaseNumber() is applicable for argument types: (java.lang.String) values: [1]
      Possible solutions: fromPhaseNumber(int), getPhaseNumber()
      	at groovy.inspect.swingui.AstNodeToScriptAdapter.main(AstNodeToScriptAdapter.groovy:56)
      	at script_from_command_line.run(script_from_command_line:1)
      

      follwing is a patch:

      $ svn diff AstNodeToScriptAdapter.groovy
      Index: AstNodeToScriptAdapter.groovy
      ===================================================================
      --- AstNodeToScriptAdapter.groovy	(revision 22473)
      +++ AstNodeToScriptAdapter.groovy	(working copy)
      @@ -52,7 +52,7 @@
       and [compilephase] is a valid Integer based org.codehaus.groovy.control.CompilePhase"""
               } else {
                   def file = new File((String) args[0])
      -            def phase = CompilePhase.fromPhaseNumber(args[1])
      +            def phase = CompilePhase.fromPhaseNumber(args[1] as int)
                   if (!file.exists()) {
                       println "File ${args[0]} cannot be found."
                   } else if (phase == null) {
      

      Attachments

        Activity

          People

            paulk Paul King
            uehaj UEHARA Junji
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: