groovy
  1. groovy
  2. GROOVY-4907

Command line interface of AstNodeToScriptAdapter.groovy don't works

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8.1, 1.7.11
    • Component/s: None
    • Labels:
      None
    • Patch Submitted:
      Yes
    • Number of attachments :
      0

      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) {
      

        Activity

        Paul King made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Paul King [ paulk ]
        Fix Version/s 1.7.11 [ 17244 ]
        Fix Version/s 1.8.1 [ 17223 ]
        Resolution Fixed [ 1 ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Paul King
            Reporter:
            UEHARA Junji
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: