LANG-794: SystemUtils.IS_OS_WINDOWS_2008, VISTA are incorrect. This also fixes #60 from github. Thanks to Timo Kockert.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1671040 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benedikt Ritter 2015-04-03 12:01:59 +00:00
parent 8c84cfda26
commit 9c7b0fb8e6
3 changed files with 26 additions and 15 deletions

View File

@ -60,6 +60,8 @@ o LANG-1045: Add method MethodUtils.invokeMethod(Object, String)
FIXED BUGS FIXED BUGS
============ ============
o LANG-794: SystemUtils.IS_OS_WINDOWS_2008, VISTA are incorrect. Thanks to
Timo Kockert.
o LANG-1104: Parse test fails for TimeZone America/Sao_Paulo o LANG-1104: Parse test fails for TimeZone America/Sao_Paulo
o LANG-948: Exception while using ExtendedMessageFormat and escaping braces. o LANG-948: Exception while using ExtendedMessageFormat and escaping braces.
Thanks to Andrey Khobnya. Thanks to Andrey Khobnya.

View File

@ -22,6 +22,7 @@
<body> <body>
<release version="3.4" date="tba" description="tba"> <release version="3.4" date="tba" description="tba">
<action issue="LANG-794" type="fix" dev="britter" due-to="Timo Kockert">SystemUtils.IS_OS_WINDOWS_2008, VISTA are incorrect</action>
<action issue="LANG-1104" type="fix" dev="chas">Parse test fails for TimeZone America/Sao_Paulo</action> <action issue="LANG-1104" type="fix" dev="chas">Parse test fails for TimeZone America/Sao_Paulo</action>
<action issue="LANG-1103" type="add" dev="britter">Add SystemUtils.IS_JAVA_1_9</action> <action issue="LANG-1103" type="add" dev="britter">Add SystemUtils.IS_JAVA_1_9</action>
<action issue="LANG-1102" type="update" dev="britter">Make logic for comparing OS versions in SystemUtils smarter</action> <action issue="LANG-1102" type="update" dev="britter">Make logic for comparing OS versions in SystemUtils smarter</action>

View File

@ -1150,7 +1150,7 @@ public class SystemUtils {
* *
* @since 2.0 * @since 2.0
*/ */
public static final boolean IS_OS_WINDOWS_2000 = getOSMatches(OS_NAME_WINDOWS_PREFIX, "5.0"); public static final boolean IS_OS_WINDOWS_2000 = getOSMatchesName(OS_NAME_WINDOWS_PREFIX + " 2000");
/** /**
* <p> * <p>
@ -1162,11 +1162,11 @@ public class SystemUtils {
* *
* @since 3.1 * @since 3.1
*/ */
public static final boolean IS_OS_WINDOWS_2003 = getOSMatches(OS_NAME_WINDOWS_PREFIX, "5.2"); public static final boolean IS_OS_WINDOWS_2003 = getOSMatchesName(OS_NAME_WINDOWS_PREFIX + " 2003");
/** /**
* <p> * <p>
* Is {@code true} if this is Windows 2008. * Is {@code true} if this is Windows Server 2008.
* </p> * </p>
* <p> * <p>
* The field will return {@code false} if {@code OS_NAME} is {@code null}. * The field will return {@code false} if {@code OS_NAME} is {@code null}.
@ -1174,7 +1174,19 @@ public class SystemUtils {
* *
* @since 3.1 * @since 3.1
*/ */
public static final boolean IS_OS_WINDOWS_2008 = getOSMatches(OS_NAME_WINDOWS_PREFIX + " Server 2008", "6.1"); public static final boolean IS_OS_WINDOWS_2008 = getOSMatchesName(OS_NAME_WINDOWS_PREFIX + " Server 2008");
/**
* <p>
* Is {@code true} if this is Windows Server 2012.
* </p>
* <p>
* The field will return {@code false} if {@code OS_NAME} is {@code null}.
* </p>
*
* @since 3.4
*/
public static final boolean IS_OS_WINDOWS_2012 = getOSMatchesName(OS_NAME_WINDOWS_PREFIX + " Server 2012");
/** /**
* <p> * <p>
@ -1186,8 +1198,7 @@ public class SystemUtils {
* *
* @since 2.0 * @since 2.0
*/ */
public static final boolean IS_OS_WINDOWS_95 = getOSMatches(OS_NAME_WINDOWS_PREFIX + " 9", "4.0"); public static final boolean IS_OS_WINDOWS_95 = getOSMatchesName(OS_NAME_WINDOWS_PREFIX + " 95");
// Java 1.2 running on Windows98 returns 'Windows 95', hence the above
/** /**
* <p> * <p>
@ -1199,8 +1210,7 @@ public class SystemUtils {
* *
* @since 2.0 * @since 2.0
*/ */
public static final boolean IS_OS_WINDOWS_98 = getOSMatches(OS_NAME_WINDOWS_PREFIX + " 9", "4.1"); public static final boolean IS_OS_WINDOWS_98 = getOSMatchesName(OS_NAME_WINDOWS_PREFIX + " 98");
// Java 1.2 running on Windows98 returns 'Windows 95', hence the above
/** /**
* <p> * <p>
@ -1212,8 +1222,7 @@ public class SystemUtils {
* *
* @since 2.0 * @since 2.0
*/ */
public static final boolean IS_OS_WINDOWS_ME = getOSMatches(OS_NAME_WINDOWS_PREFIX, "4.9"); public static final boolean IS_OS_WINDOWS_ME = getOSMatchesName(OS_NAME_WINDOWS_PREFIX + " Me");
// Java 1.2 running on WindowsME may return 'Windows 95', hence the above
/** /**
* <p> * <p>
@ -1226,7 +1235,6 @@ public class SystemUtils {
* @since 2.0 * @since 2.0
*/ */
public static final boolean IS_OS_WINDOWS_NT = getOSMatchesName(OS_NAME_WINDOWS_PREFIX + " NT"); public static final boolean IS_OS_WINDOWS_NT = getOSMatchesName(OS_NAME_WINDOWS_PREFIX + " NT");
// Windows 2000 returns 'Windows 2000' but may suffer from same Java1.2 problem
/** /**
* <p> * <p>
@ -1238,7 +1246,7 @@ public class SystemUtils {
* *
* @since 2.0 * @since 2.0
*/ */
public static final boolean IS_OS_WINDOWS_XP = getOSMatches(OS_NAME_WINDOWS_PREFIX, "5.1"); public static final boolean IS_OS_WINDOWS_XP = getOSMatchesName(OS_NAME_WINDOWS_PREFIX + " XP");
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** /**
@ -1251,7 +1259,7 @@ public class SystemUtils {
* *
* @since 2.4 * @since 2.4
*/ */
public static final boolean IS_OS_WINDOWS_VISTA = getOSMatches(OS_NAME_WINDOWS_PREFIX, "6.0"); public static final boolean IS_OS_WINDOWS_VISTA = getOSMatchesName(OS_NAME_WINDOWS_PREFIX + " Vista");
/** /**
* <p> * <p>
@ -1263,7 +1271,7 @@ public class SystemUtils {
* *
* @since 3.0 * @since 3.0
*/ */
public static final boolean IS_OS_WINDOWS_7 = getOSMatches(OS_NAME_WINDOWS_PREFIX, "6.1"); public static final boolean IS_OS_WINDOWS_7 = getOSMatchesName(OS_NAME_WINDOWS_PREFIX + " 7");
/** /**
* <p> * <p>
@ -1275,7 +1283,7 @@ public class SystemUtils {
* *
* @since 3.2 * @since 3.2
*/ */
public static final boolean IS_OS_WINDOWS_8 = getOSMatches(OS_NAME_WINDOWS_PREFIX, "6.2"); public static final boolean IS_OS_WINDOWS_8 = getOSMatchesName(OS_NAME_WINDOWS_PREFIX + " 8");
/** /**
* <p> * <p>