Add SystemUtils.IS_OS_WINDOWS_11.

This commit is contained in:
Gary Gregory 2022-06-27 10:15:57 -04:00
parent 1bad88dbc3
commit 01c61f987b
2 changed files with 20 additions and 0 deletions

View File

@ -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&lt;Throwable&gt;).</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>

View File

@ -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.