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 2016/01/06 21:10:19 UTC
groovy git commit: minimal clean-up of groovy.json.internal.Sys
Repository: groovy
Updated Branches:
refs/heads/master e1eb2f3db -> b183bee66
minimal clean-up of groovy.json.internal.Sys
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/b183bee6
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/b183bee6
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/b183bee6
Branch: refs/heads/master
Commit: b183bee6679f48c97c5d22c0f7f7835eae860abf
Parents: e1eb2f3
Author: pascalschumacher <pa...@gmx.net>
Authored: Wed Jan 6 21:09:45 2016 +0100
Committer: pascalschumacher <pa...@gmx.net>
Committed: Wed Jan 6 21:09:45 2016 +0100
----------------------------------------------------------------------
.../src/main/java/groovy/json/internal/Sys.java | 25 +++++++-------------
1 file changed, 9 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/groovy/blob/b183bee6/subprojects/groovy-json/src/main/java/groovy/json/internal/Sys.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-json/src/main/java/groovy/json/internal/Sys.java b/subprojects/groovy-json/src/main/java/groovy/json/internal/Sys.java
index 403a1ee..28caa40 100644
--- a/subprojects/groovy-json/src/main/java/groovy/json/internal/Sys.java
+++ b/subprojects/groovy-json/src/main/java/groovy/json/internal/Sys.java
@@ -24,8 +24,7 @@ import java.util.regex.Pattern;
class Sys {
- private static final boolean is1_7OorLater;
- private static final BigDecimal version;
+ private static final boolean is1_7OrLater;
private static final boolean is1_7;
private static final boolean is1_8;
@@ -37,20 +36,16 @@ class Sys {
try {
String ver = split[0];
- if (ver.startsWith("1.8")) {
- v = new BigDecimal("1.8");
+ if (ver.startsWith("1.6")) {
+ v = new BigDecimal("1.6");
}
if (ver.startsWith("1.7")) {
v = new BigDecimal("1.7");
}
- if (ver.startsWith("1.6")) {
- v = new BigDecimal("1.6");
- }
-
- if (ver.startsWith("1.5")) {
- v = new BigDecimal("1.5");
+ if (ver.startsWith("1.8")) {
+ v = new BigDecimal("1.8");
}
if (ver.startsWith("1.9")) {
@@ -70,15 +65,13 @@ class Sys {
}
}
- version = v;
-
- is1_7OorLater = version.compareTo(new BigDecimal("1.7")) >= 0;
- is1_7 = version.compareTo(new BigDecimal("1.7")) == 0;
- is1_8 = version.compareTo(new BigDecimal("1.8")) == 0;
+ is1_7OrLater = v.compareTo(new BigDecimal("1.7")) >= 0;
+ is1_7 = v.compareTo(new BigDecimal("1.7")) == 0;
+ is1_8 = v.compareTo(new BigDecimal("1.8")) == 0;
}
public static boolean is1_7OrLater() {
- return is1_7OorLater;
+ return is1_7OrLater;
}
public static boolean is1_7() {