groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [groovy] 02/03: minor refactor: use standard sys prop method to handle security exceptions and avoid being static
Date Mon, 06 May 2019 14:59:28 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 10d5294473758aeb88535c459de2457b2dee0482
Author: Paul King <paulk@asert.com.au>
AuthorDate: Thu May 2 08:33:18 2019 +1000

    minor refactor: use standard sys prop method to handle security exceptions and avoid being
static
---
 .../java/org/codehaus/groovy/classgen/asm/WriterController.java    | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java b/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java
index 28e41ad..954ae2f 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java
@@ -41,12 +41,11 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+import static org.apache.groovy.util.SystemUtil.getBooleanSafe;
+
 public class WriterController {
     private static final String GROOVY_LOG_CLASSGEN = "groovy.log.classgen";
-    private static final boolean LOG_CLASSGEN;
-    static {
-        LOG_CLASSGEN = Boolean.valueOf(System.getProperty(GROOVY_LOG_CLASSGEN));
-    }
+    private final boolean LOG_CLASSGEN = getBooleanSafe(GROOVY_LOG_CLASSGEN);
     private AsmClassGenerator acg;
     private MethodVisitor methodVisitor;
     private CompileStack compileStack;


Mime
View raw message