This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch GROOVY_3_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/GROOVY_3_0_X by this push:
new ed50323 minor refactoring
ed50323 is described below
commit ed50323dc509c103faa1d2bcc99e4ae1eed537bc
Author: Paul King <[email protected]>
AuthorDate: Thu Feb 13 10:16:26 2020 +1000
minor refactoring
---
.../codehaus/groovy/control/CompilerConfiguration.java | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git
a/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
b/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
index 38237db..5cd63cf 100644
--- a/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
+++ b/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
@@ -26,7 +26,6 @@ import org.objectweb.asm.Opcodes;
import java.io.File;
import java.io.PrintWriter;
-import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
@@ -42,6 +41,7 @@ import java.util.StringTokenizer;
import static org.apache.groovy.util.SystemUtil.getBooleanSafe;
import static org.apache.groovy.util.SystemUtil.getSystemPropertySafe;
+import static org.codehaus.groovy.runtime.StringGroovyMethods.isAtLeast;
/**
* Compilation control flags and coordination stuff.
@@ -553,7 +553,7 @@ public class CompilerConfiguration {
* @return true if the bytecode version is JDK 1.5+
*/
public static boolean isPostJDK5(final String bytecodeVersion) {
- return new BigDecimal(bytecodeVersion).compareTo(new BigDecimal(JDK5))
>= 0;
+ return isAtLeast(bytecodeVersion, JDK5);
}
/**
@@ -563,7 +563,7 @@ public class CompilerConfiguration {
* @return true if the bytecode version is JDK 1.7+
*/
public static boolean isPostJDK7(final String bytecodeVersion) {
- return new BigDecimal(bytecodeVersion).compareTo(new BigDecimal(JDK7))
>= 0;
+ return isAtLeast(bytecodeVersion, JDK7);
}
/**
@@ -573,7 +573,7 @@ public class CompilerConfiguration {
* @return true if the bytecode version is JDK 1.8+
*/
public static boolean isPostJDK8(final String bytecodeVersion) {
- return new BigDecimal(bytecodeVersion).compareTo(new BigDecimal(JDK8))
>= 0;
+ return isAtLeast(bytecodeVersion, JDK8);
}
/**
@@ -583,7 +583,7 @@ public class CompilerConfiguration {
* @return true if the bytecode version is JDK 9.0+
*/
public static boolean isPostJDK9(final String bytecodeVersion) {
- return new BigDecimal(bytecodeVersion).compareTo(new BigDecimal(JDK9))
>= 0;
+ return isAtLeast(bytecodeVersion, JDK9);
}
/**
@@ -1058,7 +1058,7 @@ public class CompilerConfiguration {
*/
public boolean isIndyEnabled() {
Boolean indyEnabled = getOptimizationOptions().get(INVOKEDYNAMIC);
- return
Optional.ofNullable(indyEnabled).orElse(Boolean.FALSE).booleanValue();
+ return Optional.ofNullable(indyEnabled).orElse(Boolean.FALSE);
}
/**
@@ -1066,7 +1066,7 @@ public class CompilerConfiguration {
*/
public boolean isGroovydocEnabled() {
Boolean groovydocEnabled = getOptimizationOptions().get(GROOVYDOC);
- return
Optional.ofNullable(groovydocEnabled).orElse(Boolean.FALSE).booleanValue();
+ return Optional.ofNullable(groovydocEnabled).orElse(Boolean.FALSE);
}
/**
@@ -1074,6 +1074,6 @@ public class CompilerConfiguration {
*/
public boolean isRuntimeGroovydocEnabled() {
Boolean runtimeGroovydocEnabled =
getOptimizationOptions().get(RUNTIME_GROOVYDOC);
- return
Optional.ofNullable(runtimeGroovydocEnabled).orElse(Boolean.FALSE).booleanValue();
+ return
Optional.ofNullable(runtimeGroovydocEnabled).orElse(Boolean.FALSE);
}
}