diff --git a/src/changes/changes.xml b/src/changes/changes.xml index ff97bc3ce..e82665653 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -22,6 +22,7 @@ + Add org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS_8 StringUtils.equalsIgnoreCase doesn't check string reference equality RandomStringUtils throws confusing IAE when end <= start RandomStringUtils.random(count, 0, 0, false, false, universe, random) always throws java.lang.ArrayIndexOutOfBoundsException diff --git a/src/main/java/org/apache/commons/lang3/SystemUtils.java b/src/main/java/org/apache/commons/lang3/SystemUtils.java index 0914b4db8..ae87e7c30 100644 --- a/src/main/java/org/apache/commons/lang3/SystemUtils.java +++ b/src/main/java/org/apache/commons/lang3/SystemUtils.java @@ -1223,6 +1223,18 @@ public class SystemUtils { */ public static final boolean IS_OS_WINDOWS_7 = getOSMatches(OS_NAME_WINDOWS_PREFIX, "6.1"); + /** + *

+ * Is {@code true} if this is Windows 8. + *

+ *

+ * The field will return {@code false} if {@code OS_NAME} is {@code null}. + *

+ * + * @since 3.2 + */ + public static final boolean IS_OS_WINDOWS_8 = getOSMatches(OS_NAME_WINDOWS_PREFIX, "6.2"); + /** *

* Gets the Java home directory as a {@code File}.