Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4974917F11 for ; Fri, 3 Apr 2015 12:02:05 +0000 (UTC) Received: (qmail 99065 invoked by uid 500); 3 Apr 2015 12:02:00 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 98991 invoked by uid 500); 3 Apr 2015 12:02:00 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 98982 invoked by uid 99); 3 Apr 2015 12:02:00 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Apr 2015 12:02:00 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id EE47CAC0069 for ; Fri, 3 Apr 2015 12:01:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1671040 - in /commons/proper/lang/trunk: RELEASE-NOTES.txt src/changes/changes.xml src/main/java/org/apache/commons/lang3/SystemUtils.java Date: Fri, 03 Apr 2015 12:01:59 -0000 To: commits@commons.apache.org From: britter@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150403120159.EE47CAC0069@hades.apache.org> Author: britter Date: Fri Apr 3 12:01:59 2015 New Revision: 1671040 URL: http://svn.apache.org/r1671040 Log: LANG-794: SystemUtils.IS_OS_WINDOWS_2008, VISTA are incorrect. This also fixes #60 from github. Thanks to Timo Kockert. Modified: commons/proper/lang/trunk/RELEASE-NOTES.txt commons/proper/lang/trunk/src/changes/changes.xml commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SystemUtils.java Modified: commons/proper/lang/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/RELEASE-NOTES.txt?rev=1671040&r1=1671039&r2=1671040&view=diff ============================================================================== --- commons/proper/lang/trunk/RELEASE-NOTES.txt (original) +++ commons/proper/lang/trunk/RELEASE-NOTES.txt Fri Apr 3 12:01:59 2015 @@ -60,6 +60,8 @@ o LANG-1045: Add method MethodUtils.invo 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-948: Exception while using ExtendedMessageFormat and escaping braces. Thanks to Andrey Khobnya. Modified: commons/proper/lang/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/changes/changes.xml?rev=1671040&r1=1671039&r2=1671040&view=diff ============================================================================== --- commons/proper/lang/trunk/src/changes/changes.xml [utf-8] (original) +++ commons/proper/lang/trunk/src/changes/changes.xml [utf-8] Fri Apr 3 12:01:59 2015 @@ -22,6 +22,7 @@ + SystemUtils.IS_OS_WINDOWS_2008, VISTA are incorrect Parse test fails for TimeZone America/Sao_Paulo Add SystemUtils.IS_JAVA_1_9 Make logic for comparing OS versions in SystemUtils smarter Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SystemUtils.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SystemUtils.java?rev=1671040&r1=1671039&r2=1671040&view=diff ============================================================================== --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SystemUtils.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SystemUtils.java Fri Apr 3 12:01:59 2015 @@ -1150,7 +1150,7 @@ public class SystemUtils { * * @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"); /** *

@@ -1162,11 +1162,11 @@ public class SystemUtils { * * @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"); /** *

- * Is {@code true} if this is Windows 2008. + * Is {@code true} if this is Windows Server 2008. *

*

* The field will return {@code false} if {@code OS_NAME} is {@code null}. @@ -1174,7 +1174,19 @@ public class SystemUtils { * * @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"); + + /** + *

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

+ *

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

+ * + * @since 3.4 + */ + public static final boolean IS_OS_WINDOWS_2012 = getOSMatchesName(OS_NAME_WINDOWS_PREFIX + " Server 2012"); /** *

@@ -1186,8 +1198,7 @@ public class SystemUtils { * * @since 2.0 */ - public static final boolean IS_OS_WINDOWS_95 = getOSMatches(OS_NAME_WINDOWS_PREFIX + " 9", "4.0"); - // Java 1.2 running on Windows98 returns 'Windows 95', hence the above + public static final boolean IS_OS_WINDOWS_95 = getOSMatchesName(OS_NAME_WINDOWS_PREFIX + " 95"); /** *

@@ -1199,8 +1210,7 @@ public class SystemUtils { * * @since 2.0 */ - public static final boolean IS_OS_WINDOWS_98 = getOSMatches(OS_NAME_WINDOWS_PREFIX + " 9", "4.1"); - // Java 1.2 running on Windows98 returns 'Windows 95', hence the above + public static final boolean IS_OS_WINDOWS_98 = getOSMatchesName(OS_NAME_WINDOWS_PREFIX + " 98"); /** *

@@ -1212,8 +1222,7 @@ public class SystemUtils { * * @since 2.0 */ - public static final boolean IS_OS_WINDOWS_ME = getOSMatches(OS_NAME_WINDOWS_PREFIX, "4.9"); - // Java 1.2 running on WindowsME may return 'Windows 95', hence the above + public static final boolean IS_OS_WINDOWS_ME = getOSMatchesName(OS_NAME_WINDOWS_PREFIX + " Me"); /** *

@@ -1226,7 +1235,6 @@ public class SystemUtils { * @since 2.0 */ 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 /** *

@@ -1238,7 +1246,7 @@ public class SystemUtils { * * @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 */ - 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"); /** *

@@ -1263,7 +1271,7 @@ public class SystemUtils { * * @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"); /** *

@@ -1275,7 +1283,7 @@ public class SystemUtils { * * @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"); /** *