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

ImportCustomizer is applied once per class (should be once per module)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-rc-2
    • Component/s: Compiler
    • Labels:

      Description

      CompilerConfiguration with ImportCustomizer gets applied once per class in a source unit. If unit has a lot of classes this can cause a lot of extra imports processing.CompilationUnit.applyToPrimaryClassNodes(PrimaryClassNodeOperation) is the loop that drives the CompilationCustomizers. org.codehaus.groovy.control.customizers.ImportCustomizer.call is where imports are added. Could check if ClassNode param is the primary class in the module before applying. Or ModuleNode could allow addImport and just dedup internally.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h