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
The following commit(s) were added to refs/heads/master by this push: new 01c61f987 Add SystemUtils.IS_OS_WINDOWS_11. 01c61f987 is described below commit 01c61f987baaa201d1145b0660acada5fd5691e4 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Mon Jun 27 10:15:57 2022 -0400 Add SystemUtils.IS_OS_WINDOWS_11. --- src/changes/changes.xml | 1 + .../java/org/apache/commons/lang3/SystemUtils.java | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 0946e7e68..4dcfedc18 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -150,6 +150,7 @@ The <action> type attribute can be add,update,fix,remove. <action type="add" dev="ggregory" due-to="Gary Gregory">Add ExceptionUtils.forEach(Throwable, Consumer<Throwable>).</action> <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> <!-- 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 a3e936409..7ba80be87 100644 --- a/src/main/java/org/apache/commons/lang3/SystemUtils.java +++ b/src/main/java/org/apache/commons/lang3/SystemUtils.java @@ -1610,6 +1610,25 @@ public class SystemUtils { */ public static final boolean IS_OS_WINDOWS_10 = getOsMatchesName(OS_NAME_WINDOWS_PREFIX + " 10"); + /** + * <p> + * Is {@code true} if this is Windows 11. + * </p> + * <p> + * The field will return {@code false} if {@code OS_NAME} is {@code null}. + * </p> + * <p> + * OpenJDK fixed the return value for {@code os.name} on Windows 11 to versions 8, 11, and 17: + * </p> + * <ul> + * <li>Affects Java versions 7u321, 8u311, 11.0.13-oracle, 17.0.1: https://bugs.openjdk.org/browse/JDK-8274737</li> + * <li>Fixed in OpenJDK commit https://github.com/openjdk/jdk/commit/97ea9dd2f24f9f1fb9b9345a4202a825ee28e014</li> + * </ul> + * + * @since 3.13.0 + */ + public static final boolean IS_OS_WINDOWS_11 = getOsMatchesName(OS_NAME_WINDOWS_PREFIX + " 11"); + /** * <p> * Is {@code true} if this is z/OS.