7170169: (props) System.getProperty("os.name") should return "Windows 8" when run on Windows 8
authorkhazra
Wed, 23 May 2012 10:41:45 -0700
changeset 12843 f785258dea60
parent 12842 f6f9cb8f6b97
child 12844 883981db17b3
child 12846 7b6641ab1122
7170169: (props) System.getProperty("os.name") should return "Windows 8" when run on Windows 8 Summary: Enable Windows Version 6.2 to be recognized as Windows 8 Reviewed-by: darcy, dholmes, alanb, chegar
jdk/src/windows/native/java/lang/java_props_md.c
--- a/jdk/src/windows/native/java/lang/java_props_md.c	Wed May 23 15:51:10 2012 +0800
+++ b/jdk/src/windows/native/java/lang/java_props_md.c	Wed May 23 10:41:45 2012 -0700
@@ -403,6 +403,7 @@
          * Windows Server 2008          6               0  (!VER_NT_WORKSTATION)
          * Windows 7                    6               1  (VER_NT_WORKSTATION)
          * Windows Server 2008 R2       6               1  (!VER_NT_WORKSTATION)
+         * Windows 8                    6               2  (VER_NT_WORKSTATION)
          *
          * This mapping will presumably be augmented as new Windows
          * versions are released.
@@ -459,6 +460,7 @@
                     switch (ver.dwMinorVersion) {
                     case  0: sprops.os_name = "Windows Vista";        break;
                     case  1: sprops.os_name = "Windows 7";            break;
+                    case  2: sprops.os_name = "Windows 8";            break;
                     default: sprops.os_name = "Windows NT (unknown)";
                     }
                 } else {