[ 
https://issues.apache.org/jira/browse/GROOVY-8399?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Milles updated GROOVY-8399:
--------------------------------
    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.  (was: 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.)

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

Reply via email to