You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/07/05 14:30:38 UTC

[commons-lang] branch master updated (6001ae8a0 -> 726935427)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git


    from 6001ae8a0 Add SystemUtils.IS_JAVA_17
     new e5e8ba090 Add SystemUtils.IS_JAVA_18
     new 726935427 Group entries together for "Add SystemUtils.IS_JAVA_*"

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/changes/changes.xml                            |  3 ++-
 .../java/org/apache/commons/lang3/SystemUtils.java | 10 +++++++
 .../org/apache/commons/lang3/SystemUtilsTest.java  | 31 ++++++++++++++++++++++
 3 files changed, 43 insertions(+), 1 deletion(-)


[commons-lang] 01/02: Add SystemUtils.IS_JAVA_18

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git

commit e5e8ba09066fadb13d6b84402d46287bbd1569b7
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 5 10:29:51 2022 -0400

    Add SystemUtils.IS_JAVA_18
---
 src/changes/changes.xml                            |  1 +
 .../java/org/apache/commons/lang3/SystemUtils.java | 10 +++++++
 .../org/apache/commons/lang3/SystemUtilsTest.java  | 31 ++++++++++++++++++++++
 3 files changed, 42 insertions(+)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 1b7ca9fe7..d344dd707 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -153,6 +153,7 @@ The <action> type attribute can be add,update,fix,remove.
     <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add ExceptionUtils.getRootCauseStackTraceList(Throwable).</action>
     <action                   type="add" dev="ggregory" due-to="Will Herrmann, Gary Gregory, Roland Kreuzer">Add SystemUtils.IS_OS_WINDOWS_11.</action>
     <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add SystemUtils.IS_JAVA_17.</action>
+    <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add SystemUtils.IS_JAVA_18.</action>
     <!-- UPDATE -->
     <action                   type="update" dev="ggregory" due-to="Dependabot, XenoAmess, Gary Gregory">Bump actions/cache from 2.1.4 to 3.0.4 #742, #752, #764, #833, #867.</action>
     <action                   type="update" dev="ggregory" due-to="Dependabot">Bump actions/checkout from 2 to 3 #819, #825, #859.</action>
diff --git a/src/main/java/org/apache/commons/lang3/SystemUtils.java b/src/main/java/org/apache/commons/lang3/SystemUtils.java
index 12db15573..2b9bec638 100644
--- a/src/main/java/org/apache/commons/lang3/SystemUtils.java
+++ b/src/main/java/org/apache/commons/lang3/SystemUtils.java
@@ -1070,6 +1070,16 @@ public class SystemUtils {
      */
     public static final boolean IS_JAVA_17 = getJavaVersionMatches("17");
 
+    /**
+     * Is {@code true} if this is Java version 18 (also 18.x versions).
+     * <p>
+     * The field will return {@code false} if {@link #JAVA_VERSION} is {@code null}.
+     * </p>
+     *
+     * @since 3.13.0
+     */
+    public static final boolean IS_JAVA_18 = getJavaVersionMatches("18");
+
     // Operating system checks
     // -----------------------------------------------------------------------
     // These MUST be declared after those above as they depend on the
diff --git a/src/test/java/org/apache/commons/lang3/SystemUtilsTest.java b/src/test/java/org/apache/commons/lang3/SystemUtilsTest.java
index 61237a232..208997daa 100644
--- a/src/test/java/org/apache/commons/lang3/SystemUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/SystemUtilsTest.java
@@ -75,6 +75,7 @@ public class SystemUtilsTest {
             assertFalse(SystemUtils.IS_JAVA_15);
             assertFalse(SystemUtils.IS_JAVA_16);
             assertFalse(SystemUtils.IS_JAVA_17);
+            assertFalse(SystemUtils.IS_JAVA_18);
         } else if (javaVersion.startsWith("1.8")) {
             assertFalse(SystemUtils.IS_JAVA_1_1);
             assertFalse(SystemUtils.IS_JAVA_1_2);
@@ -94,6 +95,7 @@ public class SystemUtilsTest {
             assertFalse(SystemUtils.IS_JAVA_15);
             assertFalse(SystemUtils.IS_JAVA_16);
             assertFalse(SystemUtils.IS_JAVA_17);
+            assertFalse(SystemUtils.IS_JAVA_18);
         } else if (javaVersion.startsWith("9")) {
             assertFalse(SystemUtils.IS_JAVA_1_1);
             assertFalse(SystemUtils.IS_JAVA_1_2);
@@ -113,6 +115,7 @@ public class SystemUtilsTest {
             assertFalse(SystemUtils.IS_JAVA_15);
             assertFalse(SystemUtils.IS_JAVA_16);
             assertFalse(SystemUtils.IS_JAVA_17);
+            assertFalse(SystemUtils.IS_JAVA_18);
         } else if (javaVersion.startsWith("10")) {
             assertFalse(SystemUtils.IS_JAVA_1_1);
             assertFalse(SystemUtils.IS_JAVA_1_2);
@@ -132,6 +135,7 @@ public class SystemUtilsTest {
             assertFalse(SystemUtils.IS_JAVA_15);
             assertFalse(SystemUtils.IS_JAVA_16);
             assertFalse(SystemUtils.IS_JAVA_17);
+            assertFalse(SystemUtils.IS_JAVA_18);
         } else if (javaVersion.startsWith("11")) {
             assertFalse(SystemUtils.IS_JAVA_1_1);
             assertFalse(SystemUtils.IS_JAVA_1_2);
@@ -151,6 +155,7 @@ public class SystemUtilsTest {
             assertFalse(SystemUtils.IS_JAVA_15);
             assertFalse(SystemUtils.IS_JAVA_16);
             assertFalse(SystemUtils.IS_JAVA_17);
+            assertFalse(SystemUtils.IS_JAVA_18);
         } else if (javaVersion.startsWith("12")) {
             assertFalse(SystemUtils.IS_JAVA_1_1);
             assertFalse(SystemUtils.IS_JAVA_1_2);
@@ -170,6 +175,7 @@ public class SystemUtilsTest {
             assertFalse(SystemUtils.IS_JAVA_15);
             assertFalse(SystemUtils.IS_JAVA_16);
             assertFalse(SystemUtils.IS_JAVA_17);
+            assertFalse(SystemUtils.IS_JAVA_18);
         } else if (javaVersion.startsWith("13")) {
             assertFalse(SystemUtils.IS_JAVA_1_1);
             assertFalse(SystemUtils.IS_JAVA_1_2);
@@ -189,6 +195,7 @@ public class SystemUtilsTest {
             assertFalse(SystemUtils.IS_JAVA_15);
             assertFalse(SystemUtils.IS_JAVA_16);
             assertFalse(SystemUtils.IS_JAVA_17);
+            assertFalse(SystemUtils.IS_JAVA_18);
         } else if (javaVersion.startsWith("14")) {
             assertFalse(SystemUtils.IS_JAVA_1_1);
             assertFalse(SystemUtils.IS_JAVA_1_2);
@@ -208,6 +215,7 @@ public class SystemUtilsTest {
             assertFalse(SystemUtils.IS_JAVA_15);
             assertFalse(SystemUtils.IS_JAVA_16);
             assertFalse(SystemUtils.IS_JAVA_17);
+            assertFalse(SystemUtils.IS_JAVA_18);
         } else if (javaVersion.startsWith("15")) {
             assertFalse(SystemUtils.IS_JAVA_1_1);
             assertFalse(SystemUtils.IS_JAVA_1_2);
@@ -227,6 +235,7 @@ public class SystemUtilsTest {
             assertTrue(SystemUtils.IS_JAVA_15);
             assertFalse(SystemUtils.IS_JAVA_16);
             assertFalse(SystemUtils.IS_JAVA_17);
+            assertFalse(SystemUtils.IS_JAVA_18);
         } else if (javaVersion.startsWith("16")) {
             assertFalse(SystemUtils.IS_JAVA_1_1);
             assertFalse(SystemUtils.IS_JAVA_1_2);
@@ -246,6 +255,7 @@ public class SystemUtilsTest {
             assertFalse(SystemUtils.IS_JAVA_15);
             assertTrue(SystemUtils.IS_JAVA_16);
             assertFalse(SystemUtils.IS_JAVA_17);
+            assertFalse(SystemUtils.IS_JAVA_18);
         } else if (javaVersion.startsWith("17")) {
             assertFalse(SystemUtils.IS_JAVA_1_1);
             assertFalse(SystemUtils.IS_JAVA_1_2);
@@ -265,6 +275,27 @@ public class SystemUtilsTest {
             assertFalse(SystemUtils.IS_JAVA_15);
             assertFalse(SystemUtils.IS_JAVA_16);
             assertTrue(SystemUtils.IS_JAVA_17);
+            assertFalse(SystemUtils.IS_JAVA_18);
+        } else if (javaVersion.startsWith("18")) {
+            assertFalse(SystemUtils.IS_JAVA_1_1);
+            assertFalse(SystemUtils.IS_JAVA_1_2);
+            assertFalse(SystemUtils.IS_JAVA_1_3);
+            assertFalse(SystemUtils.IS_JAVA_1_4);
+            assertFalse(SystemUtils.IS_JAVA_1_5);
+            assertFalse(SystemUtils.IS_JAVA_1_6);
+            assertFalse(SystemUtils.IS_JAVA_1_7);
+            assertFalse(SystemUtils.IS_JAVA_1_8);
+            assertFalse(SystemUtils.IS_JAVA_1_9);
+            assertFalse(SystemUtils.IS_JAVA_9);
+            assertFalse(SystemUtils.IS_JAVA_10);
+            assertFalse(SystemUtils.IS_JAVA_11);
+            assertFalse(SystemUtils.IS_JAVA_12);
+            assertFalse(SystemUtils.IS_JAVA_13);
+            assertFalse(SystemUtils.IS_JAVA_14);
+            assertFalse(SystemUtils.IS_JAVA_15);
+            assertFalse(SystemUtils.IS_JAVA_16);
+            assertFalse(SystemUtils.IS_JAVA_17);
+            assertTrue(SystemUtils.IS_JAVA_18);
         } else {
             System.out.println("Can't test IS_JAVA value: " + javaVersion);
         }


[commons-lang] 02/02: Group entries together for "Add SystemUtils.IS_JAVA_*"

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git

commit 726935427236a66a183997875983952e8798f84f
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jul 5 10:30:28 2022 -0400

    Group entries together for "Add SystemUtils.IS_JAVA_*"
---
 src/changes/changes.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index d344dd707..b81f2ac9b 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -112,7 +112,6 @@ The <action> type attribute can be add,update,fix,remove.
     <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add UncheckedTimeoutException.</action>
     <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add UncheckedInterruptedException.</action>
     <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add TimeZones.GMT.</action>
-    <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add SystemUtils.IS_JAVA_16.</action>
     <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add ObjectUtils.identityHashCodeHex(Object).</action>
     <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add ObjectUtils.hashCodeHex(Object).</action>
     <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add StringUtils.removeStart(String, char).</action>
@@ -152,6 +151,7 @@ The <action> type attribute can be add,update,fix,remove.
     <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add ExceptionUtils.stream(Throwable).</action>
     <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add ExceptionUtils.getRootCauseStackTraceList(Throwable).</action>
     <action                   type="add" dev="ggregory" due-to="Will Herrmann, Gary Gregory, Roland Kreuzer">Add SystemUtils.IS_OS_WINDOWS_11.</action>
+    <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add SystemUtils.IS_JAVA_16.</action>
     <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add SystemUtils.IS_JAVA_17.</action>
     <action                   type="add" dev="ggregory" due-to="Gary Gregory">Add SystemUtils.IS_JAVA_18.</action>
     <!-- UPDATE -->