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
--- a/jdk/make/common/Defs-macosx.gmk Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/make/common/Defs-macosx.gmk Mon Apr 16 18:09:53 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/jdk/make/common/shared/Platform.gmk Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/make/common/shared/Platform.gmk Mon Apr 16 18:09:53 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
@@ -264,7 +264,7 @@
echo sparc \
;; \
x86_64) \
- echo amd64 \
+ echo x86_64 \
;; \
universal) \
echo universal \
--- a/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java Mon Apr 16 18:09:53 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
@@ -60,7 +60,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/jdk/src/share/classes/java/nio/Bits.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/src/share/classes/java/nio/Bits.java Mon Apr 16 18:09:53 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/jdk/src/share/classes/java/util/prefs/Preferences.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/src/share/classes/java/util/prefs/Preferences.java Mon Apr 16 18:09:53 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
@@ -293,7 +293,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/jdk/src/share/classes/sun/awt/OSInfo.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/src/share/classes/sun/awt/OSInfo.java Mon Apr 16 18:09:53 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/jdk/src/share/classes/sun/font/FontUtilities.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/src/share/classes/sun/font/FontUtilities.java Mon Apr 16 18:09:53 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/jdk/src/share/classes/sun/launcher/LauncherHelper.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/src/share/classes/sun/launcher/LauncherHelper.java Mon Apr 16 18:09:53 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/jdk/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java Mon Apr 16 18:09:53 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/jdk/src/share/classes/sun/print/PSPrinterJob.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/src/share/classes/sun/print/PSPrinterJob.java Mon Apr 16 18:09:53 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
@@ -1567,7 +1567,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/jdk/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java Mon Apr 16 18:09:53 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
@@ -90,7 +90,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/jdk/src/share/classes/sun/security/krb5/Config.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/src/share/classes/sun/security/krb5/Config.java Mon Apr 16 18:09:53 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
@@ -737,7 +737,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/jdk/src/share/classes/sun/security/krb5/Credentials.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/src/share/classes/sun/security/krb5/Credentials.java Mon Apr 16 18:09:53 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) {
@@ -478,7 +478,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/jdk/src/share/classes/sun/security/provider/ByteArrayAccess.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/src/share/classes/sun/security/provider/ByteArrayAccess.java Mon Apr 16 18:09:53 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/jdk/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java Mon Apr 16 18:09:53 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/jdk/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java Mon Apr 16 18:09:53 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/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java Mon Apr 16 18:09:53 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/jdk/test/demo/jvmti/DemoRun.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/test/demo/jvmti/DemoRun.java Mon Apr 16 18:09:53 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/jdk/test/java/io/File/GetXSpace.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/test/java/io/File/GetXSpace.java Mon Apr 16 18:09:53 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/jdk/test/java/lang/ProcessBuilder/Basic.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/test/java/lang/ProcessBuilder/Basic.java Mon Apr 16 18:09:53 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/jdk/test/java/lang/ProcessBuilder/Zombies.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/test/java/lang/ProcessBuilder/Zombies.java Mon Apr 16 18:09:53 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/jdk/test/java/lang/invoke/InvokeGenericTest.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/test/java/lang/invoke/InvokeGenericTest.java Mon Apr 16 18:09:53 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
@@ -76,7 +76,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/jdk/test/java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/test/java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java Mon Apr 16 18:09:53 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/jdk/test/java/nio/channels/FileChannel/Size.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/test/java/nio/channels/FileChannel/Size.java Mon Apr 16 18:09:53 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/jdk/test/java/nio/channels/FileChannel/Transfer.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/test/java/nio/channels/FileChannel/Transfer.java Mon Apr 16 18:09:53 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/jdk/test/java/nio/file/FileSystem/Basic.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/test/java/nio/file/FileSystem/Basic.java Mon Apr 16 18:09:53 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/jdk/test/sun/nio/ch/SelProvider.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/test/sun/nio/ch/SelProvider.java Mon Apr 16 18:09:53 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
@@ -39,7 +39,7 @@
expected = "sun.nio.ch.DevPollSelectorProvider";
} else if ("Linux".equals(osname)) {
expected = "sun.nio.ch.EPollSelectorProvider";
- } else if (osname.startsWith("Mac OS")) {
+ } else if (osname.contains("OS X")) {
expected = "sun.nio.ch.KQueueSelectorProvider";
} else
return;
--- a/jdk/test/tools/launcher/TestHelper.java Mon Apr 16 20:12:20 2012 +0100
+++ b/jdk/test/tools/launcher/TestHelper.java Mon Apr 16 18:09:53 2012 -0400
@@ -66,7 +66,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 =