You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2020/06/14 00:35:26 UTC

[groovy] branch GROOVY-9592 created (now 50c497b)

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a change to branch GROOVY-9592
in repository https://gitbox.apache.org/repos/asf/groovy.git.


      at 50c497b  GROOVY-9592: Replace "groovy.generate.stub.in.memory" with "groovy.mem.stub"

This branch includes the following new commits:

     new 50c497b  GROOVY-9592: Replace "groovy.generate.stub.in.memory" with "groovy.mem.stub"

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[groovy] 01/01: GROOVY-9592: Replace "groovy.generate.stub.in.memory" with "groovy.mem.stub"

Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch GROOVY-9592
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 50c497b09bdf657662a4c788573fa2c778b0372e
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sun Jun 14 08:31:43 2020 +0800

    GROOVY-9592: Replace "groovy.generate.stub.in.memory" with "groovy.mem.stub"
---
 .../org/codehaus/groovy/tools/javac/JavaAwareCompilationUnit.java | 8 +++++---
 .../org/codehaus/groovy/control/CompilerConfigurationTest.java    | 1 +
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/tools/javac/JavaAwareCompilationUnit.java b/src/main/java/org/codehaus/groovy/tools/javac/JavaAwareCompilationUnit.java
index cce5faf..dd58618 100644
--- a/src/main/java/org/codehaus/groovy/tools/javac/JavaAwareCompilationUnit.java
+++ b/src/main/java/org/codehaus/groovy/tools/javac/JavaAwareCompilationUnit.java
@@ -73,12 +73,14 @@ public class JavaAwareCompilationUnit extends CompilationUnit {
             String sourceEncoding = this.configuration.getSourceEncoding();
             Object memStub = options.get(CompilerConfiguration.MEM_STUB);
             if (memStub == null) {
-                memStub = SystemUtil.getSystemPropertySafe("groovy.generate.stub.in.memory", "false");
-                options.put(CompilerConfiguration.MEM_STUB, Boolean.parseBoolean((String) memStub));
+                memStub = Boolean.parseBoolean(SystemUtil.getSystemPropertySafe("groovy.mem.stub", "false"))
+                                // the following JVM option will be removed since Groovy 4
+                            || Boolean.parseBoolean(SystemUtil.getSystemPropertySafe("groovy.generate.stub.in.memory", "false"));
+                options.put(CompilerConfiguration.MEM_STUB, memStub);
             }
 
             this.keepStubs = Boolean.TRUE.equals(options.get("keepStubs"));
-            this.memStubEnabled = Boolean.parseBoolean(memStub.toString());
+            this.memStubEnabled = Boolean.TRUE.equals(memStub);
             this.generationGoal = memStubEnabled ? null : (File) options.get("stubDir");
             this.stubGenerator = new JavaStubGenerator(generationGoal, false, atLeastJava5, sourceEncoding);
         }
diff --git a/src/test/org/codehaus/groovy/control/CompilerConfigurationTest.java b/src/test/org/codehaus/groovy/control/CompilerConfigurationTest.java
index af3308f..c1db59e 100644
--- a/src/test/org/codehaus/groovy/control/CompilerConfigurationTest.java
+++ b/src/test/org/codehaus/groovy/control/CompilerConfigurationTest.java
@@ -74,6 +74,7 @@ public final class CompilerConfigurationTest {
     public void testSetViaSystemProperties() {
         System.setProperty("groovy.warnings", "PaRaNoiA");
         System.setProperty("groovy.output.verbose", "trUE");
+        System.setProperty("groovy.mem.stub", "true");
         System.setProperty("groovy.generate.stub.in.memory", "true");
         System.setProperty("groovy.recompile.minimumInterval", "867892345");