You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2019/05/06 14:59:28 UTC

[groovy] 02/03: minor refactor: use standard sys prop method to handle security exceptions and avoid being static

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 <pa...@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;