You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (JIRA)" <ji...@apache.org> on 2017/12/02 21:25:00 UTC

[jira] [Created] (GROOVY-8399) ImportCustomizer is applied once per class (should be once per module)

Eric Milles created GROOVY-8399:
-----------------------------------

             Summary: ImportCustomizer is applied once per class (should be once per module)
                 Key: GROOVY-8399
                 URL: https://issues.apache.org/jira/browse/GROOVY-8399
             Project: Groovy
          Issue Type: Bug
          Components: Compiler
            Reporter: Eric Milles


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 is ClassNode param is the primary class in the module before applying.  Or {{ModuleNode}} could allow {{addImport}} and just dedup internally.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)