Skip to content

Commit 7e3571e

Browse files
committed
Add JavaVersion.JAVA_27
- Add SystemUtils.IS_JAVA_27 - Available now: OpenJDK JDK 27 Early-Access Builds
1 parent 53dc633 commit 7e3571e

File tree

4 files changed

+120
-1
lines changed

4 files changed

+120
-1
lines changed

src/changes/changes.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The <action> type attribute can be add,update,fix,remove.
4444
<title>Apache Commons Lang Release Notes</title>
4545
</properties>
4646
<body>
47-
<release version="3.20.1" date="YYY-MM-DD" description="This is a feature and maintenance release. Java 8 or later is required.">
47+
<release version="3.21.0" date="YYY-MM-DD" description="This is a feature and maintenance release. Java 8 or later is required.">
4848
<!-- FIX -->
4949
<action type="fix" dev="ggregory" due-to="ThrawnCA">Fix spelling and grammar in StringUtils #1486.</action>
5050
<action type="fix" dev="ggregory" due-to="Michael Hausegger, Gary Gregory">Add ConversionTest assertions to increase coverage #1489.</action>
@@ -86,6 +86,8 @@ The <action> type attribute can be add,update,fix,remove.
8686
<action type="fix" dev="ggregory" due-to="Gary Gregory">Speedup CharSequenceUtils.toCharArray(CharSequence) for String input: ~1-2% improvement (essentially identical).</action>
8787
<action type="fix" dev="ggregory" due-to="Gary Gregory">Streamline StringUtils.truncate(String, int, int).</action>
8888
<!-- ADD -->
89+
<action type="add" dev="ggregory" due-to="Gary Gregory">Add JavaVersion.JAVA_27.</action>
90+
<action type="add" dev="ggregory" due-to="Gary Gregory">Add SystemUtils.IS_JAVA_27.</action>
8991
<!-- UPDATE -->
9092
<action type="update" dev="ggregory" due-to="Gary Gregory, Dependabot">Bump org.apache.commons:commons-parent from 92 to 93 #1498.</action>
9193
<action type="update" dev="ggregory" due-to="Gary Gregory">[test] Bump org.apache.commons:commons-text from 1.14.0 to 1.15.0.</action>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,13 @@ public enum JavaVersion {
205205
*/
206206
JAVA_26(26, "26"),
207207

208+
/**
209+
* Java 27.
210+
*
211+
* @since 3.21.0
212+
*/
213+
JAVA_27(27, "27"),
214+
208215
/**
209216
* The most recent Java version. Mainly introduced to avoid to break when a new version of Java is used.
210217
*/

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,22 @@ public class SystemUtils {
11711171
*/
11721172
public static final boolean IS_JAVA_26 = getJavaVersionMatches("26");
11731173

1174+
/**
1175+
* The constant {@code true} if this is Java version 27 (also 27.x versions).
1176+
* <p>
1177+
* The result depends on the value of the {@link #JAVA_SPECIFICATION_VERSION} constant.
1178+
* </p>
1179+
* <p>
1180+
* The field will return {@code false} if {@link #JAVA_SPECIFICATION_VERSION} is {@code null}.
1181+
* </p>
1182+
* <p>
1183+
* This value is initialized when the class is loaded.
1184+
* </p>
1185+
*
1186+
* @since 3.21.0
1187+
*/
1188+
public static final boolean IS_JAVA_27 = getJavaVersionMatches("27");
1189+
11741190
// Operating system checks
11751191
// -----------------------------------------------------------------------
11761192
// These MUST be declared after those above as they depend on the

0 commit comments

Comments
 (0)