You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by bd...@apache.org on 2016/06/24 17:00:23 UTC

[1/2] shiro git commit: Add java 1.8 to JavaEnvironment

Repository: shiro
Updated Branches:
  refs/heads/1.2.x 9f36ed43f -> 227c35727


Add java 1.8 to JavaEnvironment

Without this the java version is detected as 1.3.

Fixes: SHIRO-545


Project: http://git-wip-us.apache.org/repos/asf/shiro/repo
Commit: http://git-wip-us.apache.org/repos/asf/shiro/commit/46b89bf8
Tree: http://git-wip-us.apache.org/repos/asf/shiro/tree/46b89bf8
Diff: http://git-wip-us.apache.org/repos/asf/shiro/diff/46b89bf8

Branch: refs/heads/1.2.x
Commit: 46b89bf8fd17b359c4891b9d08dad7c344c5d5f9
Parents: 9f36ed4
Author: Brian Demers <bd...@stormpath.com>
Authored: Tue Jun 21 09:48:45 2016 -0700
Committer: Brian Demers <bd...@stormpath.com>
Committed: Tue Jun 21 09:49:51 2016 -0700

----------------------------------------------------------------------
 .../org/apache/shiro/util/JavaEnvironment.java  | 23 ++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/shiro/blob/46b89bf8/core/src/main/java/org/apache/shiro/util/JavaEnvironment.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/shiro/util/JavaEnvironment.java b/core/src/main/java/org/apache/shiro/util/JavaEnvironment.java
index 455d168..1dcb79b 100644
--- a/core/src/main/java/org/apache/shiro/util/JavaEnvironment.java
+++ b/core/src/main/java/org/apache/shiro/util/JavaEnvironment.java
@@ -59,6 +59,11 @@ public abstract class JavaEnvironment {
      */
     public static final int JAVA_17 = 4;
 
+    /**
+     * Constant identifying the 1.8 JVM.
+     */
+    public static final int JAVA_18 = 5;
+
     /** The virtual machine version, i.e. <code>System.getProperty("java.version");</code>. */
     private static final String version;
 
@@ -76,13 +81,19 @@ public abstract class JavaEnvironment {
     static {
         version = System.getProperty("java.version");
         // version String should look like "1.4.2_10"
-        if (version.indexOf("1.7.") != -1) {
+
+// NOTE:   JDK 1.9 will be versioned differently '9' and/or 9.x.x
+// https://blogs.oracle.com/java-platform-group/entry/a_new_jdk_9_version
+
+        if (version.contains("1.8.")) {
+            majorVersion = JAVA_18;
+        } else if (version.contains("1.7.")) {
             majorVersion = JAVA_17;
-        } else if (version.indexOf("1.6.") != -1) {
+        } else if (version.contains("1.6.")) {
             majorVersion = JAVA_16;
-        } else if (version.indexOf("1.5.") != -1) {
+        } else if (version.contains("1.5.")) {
             majorVersion = JAVA_15;
-        } else if (version.indexOf("1.4.") != -1) {
+        } else if (version.contains("1.4.")) {
             majorVersion = JAVA_14;
         } else {
             // else leave 1.3 as default (it's either 1.3 or unknown)
@@ -112,6 +123,7 @@ public abstract class JavaEnvironment {
      * @see #JAVA_15
      * @see #JAVA_16
      * @see #JAVA_17
+     * @see #JAVA_18
      */
     public static int getMajorVersion() {
         return majorVersion;
@@ -126,6 +138,7 @@ public abstract class JavaEnvironment {
      * @see #JAVA_15
      * @see #JAVA_16
      * @see #JAVA_17
+     * @see #JAVA_18
      */
     public static boolean isAtLeastVersion14() {
         return getMajorVersion() >= JAVA_14;
@@ -140,6 +153,7 @@ public abstract class JavaEnvironment {
      * @see #JAVA_15
      * @see #JAVA_16
      * @see #JAVA_17
+     * @see #JAVA_18
      */
     public static boolean isAtLeastVersion15() {
         return getMajorVersion() >= JAVA_15;
@@ -154,6 +168,7 @@ public abstract class JavaEnvironment {
      * @see #JAVA_15
      * @see #JAVA_16
      * @see #JAVA_17
+     * @see #JAVA_18
      *
      * @since 1.2
      */


[2/2] shiro git commit: Correcting encoding in root pom.

Posted by bd...@apache.org.
Correcting encoding in root pom.

I'm not sure why this was changed, switching back to UTF-8 (from UTF8)

Fixes: SHIRO-567


Project: http://git-wip-us.apache.org/repos/asf/shiro/repo
Commit: http://git-wip-us.apache.org/repos/asf/shiro/commit/227c3572
Tree: http://git-wip-us.apache.org/repos/asf/shiro/tree/227c3572
Diff: http://git-wip-us.apache.org/repos/asf/shiro/diff/227c3572

Branch: refs/heads/1.2.x
Commit: 227c357274488cacc9ed16f47b1c78785a50893a
Parents: 46b89bf
Author: Brian Demers <bd...@stormpath.com>
Authored: Fri Jun 24 09:58:45 2016 -0700
Committer: Brian Demers <bd...@stormpath.com>
Committed: Fri Jun 24 09:58:45 2016 -0700

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/shiro/blob/227c3572/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a37148a..66abb2e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
   ~ Licensed to the Apache Software Foundation (ASF) under one
   ~ or more contributor license agreements.  See the NOTICE file