Skip to content

Commit f24c027

Browse files
committed
Add JavaVersion.JAVA_26
Add SystemUtils.IS_JAVA_26
1 parent cc5ecf5 commit f24c027

File tree

4 files changed

+117
-0
lines changed

4 files changed

+117
-0
lines changed

src/changes/changes.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ The <action> type attribute can be add,update,fix,remove.
5757
<!-- ADD -->
5858
<action type="add" dev="ggregory" due-to="Gary Gregory">Add SystemProperties.getPath(String, Supplier&lt;Path&gt;).</action>
5959
<action type="add" dev="ggregory" due-to="Gary Gregory">Add JavaVersion.JAVA_25.</action>
60+
<action type="add" dev="ggregory" due-to="Gary Gregory">Add JavaVersion.JAVA_26.</action>
6061
<action type="add" dev="ggregory" due-to="Gary Gregory">Add SystemUtils.IS_JAVA_25.</action>
62+
<action type="add" dev="ggregory" due-to="Gary Gregory">Add SystemUtils.IS_JAVA_26.</action>
6163
<action type="add" dev="ggregory" due-to="jack5505, Gary Gregory">Add MutablePair.ofNonNull(Map.Entry).</action>
6264
<action type="add" dev="ggregory" due-to="Gary Gregory">Add TimedSemaphore.builder(), Builder, and deprecate constructors.</action>
6365
<!-- UPDATE -->

src/main/java/org/apache/commons/lang3/JavaVersion.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,13 @@ public enum JavaVersion {
198198
*/
199199
JAVA_25(25, "25"),
200200

201+
/**
202+
* Java 26.
203+
*
204+
* @since 3.20.0
205+
*/
206+
JAVA_26(26, "26"),
207+
201208
/**
202209
* The most recent Java version. Mainly introduced to avoid to break when a new version of Java is used.
203210
*/

src/main/java/org/apache/commons/lang3/SystemUtils.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,22 @@ public class SystemUtils {
11551155
*/
11561156
public static final boolean IS_JAVA_25 = getJavaVersionMatches("25");
11571157

1158+
/**
1159+
* The constant {@code true} if this is Java version 26 (also 26.x versions).
1160+
* <p>
1161+
* The result depends on the value of the {@link #JAVA_SPECIFICATION_VERSION} constant.
1162+
* </p>
1163+
* <p>
1164+
* The field will return {@code false} if {@link #JAVA_SPECIFICATION_VERSION} is {@code null}.
1165+
* </p>
1166+
* <p>
1167+
* This value is initialized when the class is loaded.
1168+
* </p>
1169+
*
1170+
* @since 3.20.0
1171+
*/
1172+
public static final boolean IS_JAVA_26 = getJavaVersionMatches("26");
1173+
11581174
// Operating system checks
11591175
// -----------------------------------------------------------------------
11601176
// These MUST be declared after those above as they depend on the

0 commit comments

Comments
 (0)