You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2013/06/20 20:41:02 UTC

git commit: Make JDK version check smarter about parsing a string like "1.7.0_12-ea"

Updated Branches:
  refs/heads/master c42c1c0d2 -> e20b44a5b


Make JDK version check smarter about parsing a string like "1.7.0_12-ea"


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/e20b44a5
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/e20b44a5
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/e20b44a5

Branch: refs/heads/master
Commit: e20b44a5ba06946bbe62aa018e4341bbadc7bbee
Parents: c42c1c0
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Thu Jun 20 11:40:51 2013 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Thu Jun 20 11:40:51 2013 -0700

----------------------------------------------------------------------
 build.gradle | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/e20b44a5/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 4ba47fe..67fdcac 100755
--- a/build.gradle
+++ b/build.gradle
@@ -500,7 +500,12 @@ boolean isJDK7() {
 // http://www.kb.cert.org/vuls/id/225657
 boolean checkJDK() {
     def jdkVersion = System.properties['java.version']
-    def minor = Integer.valueOf(jdkVersion.substring(jdkVersion.indexOf("_")+1))
+    def match = jdkVersion =~ /_(\d+)/
+
+    if (! match.find())
+      throw new IllegalStateException("""Could not parse minor version number out of "#{jdkVersion}".""")
+
+    def minor = match[0][1].toInteger()
 
     if (jdkVersion.startsWith("1.7")) {
         minor > 21