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

Inefficiency in MethodNode and ConstructorNode

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-beta-1, 2.5.7, 2.4.17
    • Component/s: None
    • Labels:
      None

      Description

      The constructor of MethodNode performs VariableScope scope = new VariableScope(); setVariableScope(scope); followed by setParameters(parameters);, which in turn creates a variable scope, populates it and sets it. The first variable scope is superflous and those 2 lines could be deleted.

      Also, the constructor of ConstructorNode calls the super constructor and then creates a variable scope, fills it with param info and sets it. Since the super constructor (as described above) already calls setParameters, the extra variable scope created in ConstructorNode could be removed.

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              emilles Eric Milles
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: