Repository: groovy Updated Branches: refs/heads/master 5560532e3 -> 8f0fdf0f0
Minor refactoring Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/8f0fdf0f Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/8f0fdf0f Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/8f0fdf0f Branch: refs/heads/master Commit: 8f0fdf0f007b8ec9caaa35754f0c2f50dc8a56c8 Parents: 5560532 Author: sunlan <[email protected]> Authored: Sun Aug 27 18:35:09 2017 +0800 Committer: sunlan <[email protected]> Committed: Sun Aug 27 18:35:09 2017 +0800 ---------------------------------------------------------------------- .../org/codehaus/groovy/control/CompilerConfiguration.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/8f0fdf0f/src/main/org/codehaus/groovy/control/CompilerConfiguration.java ---------------------------------------------------------------------- diff --git a/src/main/org/codehaus/groovy/control/CompilerConfiguration.java b/src/main/org/codehaus/groovy/control/CompilerConfiguration.java index 2c5293d..267f55d 100644 --- a/src/main/org/codehaus/groovy/control/CompilerConfiguration.java +++ b/src/main/org/codehaus/groovy/control/CompilerConfiguration.java @@ -26,6 +26,7 @@ import org.objectweb.asm.Opcodes; import java.io.File; import java.io.PrintWriter; +import java.math.BigDecimal; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -412,10 +413,7 @@ public class CompilerConfiguration { * @return true if the bytecode version is JDK 1.5+ */ public static boolean isPostJDK5(String bytecodeVersion) { - return JDK5.equals(bytecodeVersion) - || JDK6.equals(bytecodeVersion) - || JDK7.equals(bytecodeVersion) - || JDK8.equals(bytecodeVersion); + return new BigDecimal(bytecodeVersion).compareTo(new BigDecimal(JDK5)) >= 0; } /** @@ -425,8 +423,7 @@ public class CompilerConfiguration { * @return true if the bytecode version is JDK 1.7+ */ public static boolean isPostJDK7(String bytecodeVersion) { - return JDK7.equals(bytecodeVersion) - || JDK8.equals(bytecodeVersion); + return new BigDecimal(bytecodeVersion).compareTo(new BigDecimal(JDK7)) >= 0; } /**
