groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [groovy] 02/05: GROOVY-9122: code smell in ProcessingUnit
Date Fri, 17 May 2019 03:34:14 GMT
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 746e104ee592031c82bfc494e98f9e79e3b67313
Author: Paul King <paulk@asert.com.au>
AuthorDate: Fri May 17 11:50:39 2019 +1000

    GROOVY-9122: code smell in ProcessingUnit
---
 .../java/org/codehaus/groovy/control/ProcessingUnit.java   | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/control/ProcessingUnit.java b/src/main/java/org/codehaus/groovy/control/ProcessingUnit.java
index b37793e..c279363 100644
--- a/src/main/java/org/codehaus/groovy/control/ProcessingUnit.java
+++ b/src/main/java/org/codehaus/groovy/control/ProcessingUnit.java
@@ -59,9 +59,10 @@ public abstract class ProcessingUnit {
      * Initializes the ProcessingUnit to the empty state.
      */
     public ProcessingUnit(final CompilerConfiguration configuration, final GroovyClassLoader
classLoader, final ErrorCollector errorCollector) {
+        setConfiguration(configuration != null ? configuration : CompilerConfiguration.DEFAULT);
         setClassLoader(classLoader);
-        configure(configuration != null ? configuration : CompilerConfiguration.DEFAULT);
         this.errorCollector = errorCollector != null ? errorCollector : new ErrorCollector(getConfiguration());
+        configure(getConfiguration());
     }
 
 
@@ -69,15 +70,20 @@ public abstract class ProcessingUnit {
      * Reconfigures the ProcessingUnit.
      */
     public void configure(CompilerConfiguration configuration) {
-        this.configuration = configuration;
+        setConfiguration(configuration);
     }
 
-
+    /**
+     * Get the CompilerConfiguration for this ProcessingUnit.
+     */
     public CompilerConfiguration getConfiguration() {
         return configuration;
     }
 
-    public void setConfiguration(CompilerConfiguration configuration) {
+    /**
+     * Sets the CompilerConfiguration for this ProcessingUnit.
+     */
+    public final void setConfiguration(CompilerConfiguration configuration) {
         this.configuration = configuration;
     }
 


Mime
View raw message