Mercurial > hg > openjdk > icedtea > jdk7 > jdk
changeset 5208:68961e0a6ea4
7130404: [macosx] "os.arch" value should be "x86_64" for compatibility with Apple JDK6
Summary: On Mac OS X, align system property "os.arch" with Apple legacy JDKs. Also, improve os.name string matching by using .contains() method instead of .startsWith(). This fix spans multiple repositories.
Reviewed-by: dcubed, phh, ohair, katleman
line wrap: on
line diff
--- a/make/common/Defs-macosx.gmk Tue Apr 03 17:14:02 2012 -0700 +++ b/make/common/Defs-macosx.gmk Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -111,10 +111,10 @@ # For all platforms, do not omit the frame pointer register usage. # We need this frame pointer to make it easy to walk the stacks. -# This should be the default on X86, but ia64 and amd64 may not have this -# as the default. -CFLAGS_REQUIRED_amd64 += -m64 -fno-omit-frame-pointer -D_LITTLE_ENDIAN -LDFLAGS_COMMON_amd64 += -m64 +# This should be the default on X86, but ia64, and x86_64 +# may not have this as the default. +CFLAGS_REQUIRED_x86_64 += -m64 -fno-omit-frame-pointer -D_LITTLE_ENDIAN +LDFLAGS_COMMON_x86_64 += -m64 CFLAGS_REQUIRED_i586 += -m32 -fno-omit-frame-pointer -D_LITTLE_ENDIAN LDFLAGS_COMMON_i586 += -m32 CFLAGS_REQUIRED_ia64 += -m64 -fno-omit-frame-pointer -D_LITTLE_ENDIAN @@ -168,7 +168,7 @@ PIC_CODE_SMALL = -fpic GLOBAL_KPIC = $(PIC_CODE_LARGE) CFLAGS_COMMON += $(GLOBAL_KPIC) $(GCC_WARNINGS) -ifeq ($(ARCH), amd64) +ifeq ($(ARCH), x86_64) CFLAGS_COMMON += -pipe endif
--- a/make/common/shared/Platform.gmk Tue Apr 03 17:14:02 2012 -0700 +++ b/make/common/shared/Platform.gmk Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -262,7 +262,7 @@ echo sparc \ ;; \ x86_64) \ - echo amd64 \ + echo x86_64 \ ;; \ "Power Macintosh") \ echo ppc \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/macosx/bin/x86_64/jvm.cfg Wed Apr 04 12:45:03 2012 -0400 @@ -0,0 +1,39 @@ +# +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# List of JVMs that can be used as an option to java, javac, etc. +# Order is important -- first in this list is the default JVM. +# NOTE that this both this file and its format are UNSUPPORTED and +# WILL GO AWAY in a future release. +# +# You may also select a JVM in an arbitrary location with the +# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported +# and may not be available in a future release. +# +-server KNOWN +-client IGNORE +-hotspot ERROR +-classic WARN +-native ERROR +-green ERROR
--- a/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java Tue Apr 03 17:14:02 2012 -0700 +++ b/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,7 +62,7 @@ /** * flag set if the native connect() call not to be used */ - private final static boolean connectDisabled = os.startsWith("Mac OS"); + private final static boolean connectDisabled = os.contains("OS X"); /** * Load net library into runtime.
--- a/src/share/classes/java/nio/Bits.java Tue Apr 03 17:14:02 2012 -0700 +++ b/src/share/classes/java/nio/Bits.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -609,7 +609,7 @@ String arch = AccessController.doPrivileged( new sun.security.action.GetPropertyAction("os.arch")); unaligned = arch.equals("i386") || arch.equals("x86") - || arch.equals("amd64"); + || arch.equals("amd64") || arch.equals("x86_64"); unalignedKnown = true; return unaligned; }
--- a/src/share/classes/java/util/prefs/Preferences.java Tue Apr 03 17:14:02 2012 -0700 +++ b/src/share/classes/java/util/prefs/Preferences.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -295,7 +295,7 @@ String platformFactory; if (osName.startsWith("Windows")) { platformFactory = "java.util.prefs.WindowsPreferencesFactory"; - } else if (osName.startsWith("Mac OS X")) { + } else if (osName.contains("OS X")) { platformFactory = "java.util.prefs.MacOSXPreferencesFactory"; } else { platformFactory = "java.util.prefs.FileSystemPreferencesFactory";
--- a/src/share/classes/sun/awt/OSInfo.java Tue Apr 03 17:14:02 2012 -0700 +++ b/src/share/classes/sun/awt/OSInfo.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -101,7 +101,7 @@ return SOLARIS; } - if (osName.startsWith("Mac OS X")) { + if (osName.contains("OS X")) { return MACOSX; }
--- a/src/share/classes/sun/font/FontUtilities.java Tue Apr 03 17:14:02 2012 -0700 +++ b/src/share/classes/sun/font/FontUtilities.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,7 +78,7 @@ isLinux = osName.startsWith("Linux"); - isMacOSX = osName.startsWith("Mac OS X"); // TODO: MacOSX + isMacOSX = osName.contains("OS X"); // TODO: MacOSX String t2kStr = System.getProperty("sun.java2d.font.scaler"); if (t2kStr != null) {
--- a/src/share/classes/sun/launcher/LauncherHelper.java Tue Apr 03 17:14:02 2012 -0700 +++ b/src/share/classes/sun/launcher/LauncherHelper.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -381,7 +381,7 @@ PrintStream ostream = (printToStderr) ? System.err : System.out; ostream.println(getLocalizedMessage("java.launcher.X.usage", File.pathSeparator)); - if (System.getProperty("os.name").startsWith("Mac OS")) { + if (System.getProperty("os.name").contains("OS X")) { ostream.println(getLocalizedMessage("java.launcher.X.macosx.usage", File.pathSeparator)); }
--- a/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java Tue Apr 03 17:14:02 2012 -0700 +++ b/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1280,7 +1280,7 @@ String osName = AccessController.doPrivileged( new GetPropertyAction("os.name")); if ("SunOS".equals(osName) || "Linux".equals(osName) - || osName.startsWith("Mac OS")) { + || osName.contains("OS X")) { charset("x-COMPOUND_TEXT", "COMPOUND_TEXT", new String[] { "COMPOUND_TEXT", // JDK historical
--- a/src/share/classes/sun/print/PSPrinterJob.java Tue Apr 03 17:14:02 2012 -0700 +++ b/src/share/classes/sun/print/PSPrinterJob.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1536,7 +1536,7 @@ } String osname = System.getProperty("os.name"); - if (osname.equals("Linux") || osname.startsWith("Mac OS X")) { + if (osname.equals("Linux") || osname.contains("OS X")) { execCmd = new String[ncomps]; execCmd[n++] = "/usr/bin/lpr"; if ((pFlags & PRINTER) != 0) {
--- a/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java Tue Apr 03 17:14:02 2012 -0700 +++ b/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -89,7 +89,7 @@ "libgssapi_krb5.so", "libgssapi_krb5.so.2", }; - } else if (osname.startsWith("Mac OS X")) { + } else if (osname.contains("OS X")) { gssLibs = new String[]{ "/usr/lib/sasl2/libgssapiv2.2.so", };
--- a/src/share/classes/sun/security/krb5/Config.java Tue Apr 03 17:14:02 2012 -0700 +++ b/src/share/classes/sun/security/krb5/Config.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -729,7 +729,7 @@ } } else if (osname.startsWith("SunOS")) { name = "/etc/krb5/krb5.conf"; - } else if (osname.startsWith("Mac")) { + } else if (osname.contains("OS X")) { if (isMacosLionOrBetter()) return ""; name = findMacosConfigFile(); } else {
--- a/src/share/classes/sun/security/krb5/Credentials.java Tue Apr 03 17:14:02 2012 -0700 +++ b/src/share/classes/sun/security/krb5/Credentials.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -289,7 +289,7 @@ String os = java.security.AccessController.doPrivileged( new sun.security.action.GetPropertyAction("os.name")); if (os.toUpperCase(Locale.ENGLISH).startsWith("WINDOWS") || - os.toUpperCase(Locale.ENGLISH).startsWith("MAC")) { + os.toUpperCase(Locale.ENGLISH).contains("OS X")) { Credentials creds = acquireDefaultCreds(); if (creds == null) { if (DEBUG) { @@ -471,7 +471,7 @@ java.security.AccessController.doPrivileged( new java.security.PrivilegedAction<Void> () { public Void run() { - if (System.getProperty("os.name").startsWith("Mac")) { + if (System.getProperty("os.name").contains("OS X")) { System.loadLibrary("osxkrb5"); } else { System.loadLibrary("w2k_lsa_auth");
--- a/src/share/classes/sun/security/provider/ByteArrayAccess.java Tue Apr 03 17:14:02 2012 -0700 +++ b/src/share/classes/sun/security/provider/ByteArrayAccess.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -95,7 +95,8 @@ private static boolean unaligned() { String arch = java.security.AccessController.doPrivileged (new sun.security.action.GetPropertyAction("os.arch", "")); - return arch.equals("i386") || arch.equals("x86") || arch.equals("amd64"); + return arch.equals("i386") || arch.equals("x86") || arch.equals("amd64") + || arch.equals("x86_64"); } /**
--- a/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java Tue Apr 03 17:14:02 2012 -0700 +++ b/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ return new SolarisAsynchronousChannelProvider(); if (osname.equals("Linux")) return new LinuxAsynchronousChannelProvider(); - if (osname.startsWith("Mac OS")) + if (osname.contains("OS X")) return new BsdAsynchronousChannelProvider(); throw new InternalError("platform not recognized"); }
--- a/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java Tue Apr 03 17:14:02 2012 -0700 +++ b/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -68,7 +68,7 @@ return createProvider("sun.nio.fs.SolarisFileSystemProvider"); if (osname.equals("Linux")) return createProvider("sun.nio.fs.LinuxFileSystemProvider"); - if (osname.equals("Darwin") || osname.startsWith("Mac OS X")) + if (osname.equals("Darwin") || osname.contains("OS X")) return createProvider("sun.nio.fs.BsdFileSystemProvider"); throw new AssertionError("Platform not recognized"); }
--- a/src/solaris/classes/sun/print/UnixPrintServiceLookup.java Tue Apr 03 17:14:02 2012 -0700 +++ b/src/solaris/classes/sun/print/UnixPrintServiceLookup.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -120,7 +120,7 @@ static boolean isBSD() { return (osname.equals("Linux") || - osname.startsWith("Mac OS X")); + osname.contains("OS X")); } static final int UNINITIALIZED = -1;
--- a/test/demo/jvmti/DemoRun.java Tue Apr 03 17:14:02 2012 -0700 +++ b/test/demo/jvmti/DemoRun.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -124,7 +124,7 @@ String os_name = System.getProperty("os.name"); String libprefix = os_name.contains("Windows")?"":"lib"; String libsuffix = os_name.contains("Windows")?".dll": - os_name.startsWith("Mac OS")?".dylib":".so"; + os_name.contains("OS X")?".dylib":".so"; boolean d64 = ( os_name.contains("Solaris") || os_name.contains("SunOS") ) && ( os_arch.equals("sparcv9") ||
--- a/test/java/io/File/GetXSpace.java Tue Apr 03 17:14:02 2012 -0700 +++ b/test/java/io/File/GetXSpace.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,7 @@ private static final String dfFormat; static { if (name.equals("SunOS") || name.equals("Linux") - || name.startsWith("Mac OS")) { + || name.contains("OS X")) { // FileSystem Total Used Available Use% MountedOn dfFormat = "([^\\s]+)\\s+(\\d+)\\s+\\d+\\s+(\\d+)\\s+\\d+%\\s+([^\\s]+)"; } else if (name.startsWith("Windows")) {
--- a/test/java/lang/ProcessBuilder/Basic.java Tue Apr 03 17:14:02 2012 -0700 +++ b/test/java/lang/ProcessBuilder/Basic.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -597,7 +597,7 @@ static class MacOSX { public static boolean is() { return is; } private static final String osName = System.getProperty("os.name"); - private static final boolean is = osName.startsWith("Mac OS"); + private static final boolean is = osName.contains("OS X"); } static class True {
--- a/test/java/lang/ProcessBuilder/Zombies.java Tue Apr 03 17:14:02 2012 -0700 +++ b/test/java/lang/ProcessBuilder/Zombies.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ static final String os = System.getProperty("os.name"); - static final String TrueCommand = os.startsWith("Mac OS")? + static final String TrueCommand = os.contains("OS X")? "/usr/bin/true" : "/bin/true"; public static void main(String[] args) throws Throwable {
--- a/test/java/lang/invoke/InvokeGenericTest.java Tue Apr 03 17:14:02 2012 -0700 +++ b/test/java/lang/invoke/InvokeGenericTest.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -75,7 +75,7 @@ String name = properties.getProperty("java.vm.name"); String arch = properties.getProperty("os.arch"); if ((arch.equals("amd64") || arch.equals("i386") || arch.equals("x86") || - arch.equals("sparc") || arch.equals("sparcv9")) && + arch.equals("x86_64") || arch.equals("sparc") || arch.equals("sparcv9")) && (name.contains("Client") || name.contains("Server")) ) { platformOK = true;
--- a/test/java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java Tue Apr 03 17:14:02 2012 -0700 +++ b/test/java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -80,7 +80,7 @@ } private static String LOAD_AVERAGE_TEXT - = System.getProperty("os.name").startsWith("Mac OS") + = System.getProperty("os.name").contains("OS X") ? "load averages:" : "load average:"; @@ -99,7 +99,7 @@ System.out.println("Load average returned from uptime = " + output); System.out.println("getSystemLoadAverage() returned " + loadavg); - String[] lavg = System.getProperty("os.name").startsWith("Mac OS") + String[] lavg = System.getProperty("os.name").contains("OS X") ? output.split(" ") : output.split(","); double expected = Double.parseDouble(lavg[0]);
--- a/test/java/nio/channels/FileChannel/Size.java Tue Apr 03 17:14:02 2012 -0700 +++ b/test/java/nio/channels/FileChannel/Size.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,7 +69,7 @@ // Windows and Linux can't handle the really large file sizes for a truncate // or a positional write required by the test for 4563125 String osName = System.getProperty("os.name"); - if (osName.startsWith("SunOS") || osName.startsWith("Mac OS")) { + if (osName.startsWith("SunOS") || osName.contains("OS X")) { blah = File.createTempFile("blah", null); long testSize = ((long)Integer.MAX_VALUE) * 2; initTestFile(blah, 10);
--- a/test/java/nio/channels/FileChannel/Transfer.java Tue Apr 03 17:14:02 2012 -0700 +++ b/test/java/nio/channels/FileChannel/Transfer.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -228,7 +228,7 @@ // Windows and Linux can't handle the really large file sizes for a // truncate or a positional write required by the test for 4563125 String osName = System.getProperty("os.name"); - if (!(osName.startsWith("SunOS") || osName.startsWith("Mac OS"))) + if (!(osName.startsWith("SunOS") || osName.contains("OS X"))) return; File source = File.createTempFile("blah", null); source.deleteOnExit();
--- a/test/java/nio/file/FileSystem/Basic.java Tue Apr 03 17:14:02 2012 -0700 +++ b/test/java/nio/file/FileSystem/Basic.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -76,7 +76,7 @@ checkSupported(fs, "posix", "unix", "owner", "acl", "user"); if (os.equals("Linux")) checkSupported(fs, "posix", "unix", "owner", "dos", "user"); - if (os.startsWith("Mac OS")) + if (os.contains("OS X")) checkSupported(fs, "posix", "unix", "owner"); if (os.equals("Windows")) checkSupported(fs, "owner", "dos", "acl", "user");
--- a/test/sun/nio/ch/SelProvider.java Tue Apr 03 17:14:02 2012 -0700 +++ b/test/sun/nio/ch/SelProvider.java Wed Apr 04 12:45:03 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ } else { throw new RuntimeException("Test does not recognize this operating system"); } - } else if (osname.startsWith("Mac OS")) { + } else if (osname.contains("OS X")) { expected = "sun.nio.ch.PollSelectorProvider"; } else return;
--- a/test/tools/launcher/TestHelper.java Tue Apr 03 17:14:02 2012 -0700 +++ b/test/tools/launcher/TestHelper.java Wed Apr 04 12:45:03 2012 -0400 @@ -58,7 +58,7 @@ static final boolean isWindows = System.getProperty("os.name", "unknown").startsWith("Windows"); static final boolean isMacOSX = - System.getProperty("os.name", "unknown").startsWith("Mac"); + System.getProperty("os.name", "unknown").contains("OS X"); static final boolean is64Bit = System.getProperty("sun.arch.data.model").equals("64"); static final boolean is32Bit =