RFR: 7178922 : (props) re-visit how os.name is determined on Mac

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Tue Nov 13 17:05:22 PST 2012


So many efforts was done to unify this style across the jdk
http://monaco.sfbay.sun.com/detail.jsf?cr=7147461
http://monaco.sfbay.sun.com/detail.jsf?cr=7130404
changesets
http://hg.openjdk.java.net/jdk8/awt/jdk/rev/77b35c5c4b95
http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/970cbbba54b0
http://closedjdk.us.oracle.com/hsx/hotspot-rt/hotspot/test/closed/rev/40505e5a55e8

Note that official documentation from apple suggest: contains("OS X")
https://developer.apple.com/library/mac/#technotes/tn2002/tn2110.html

14.11.2012 2:50, Brent Christian wrote:
> At present, the JDK port for OS X gets its value for os.name from a 
> JRS function exported by the Apple Java Runtime Support framework.
>
> Historically this has either been "Mac OS X", or "Mac OS X Server", 
> but there have been reports that this could change at any time, e.g.
> to just "OS X".  This would break any app that relies on this property
> to detect the Mac platform using something like:
>
> System.getProperty("os.name").startsWith("Mac").
>
> To ensure compatibility going forward, the os.name System property on 
> Mac should be hard-coded to the value that is expected, "Mac OS X". 
> (FWIW, as of 10.7 Mac OS X Server is no longer a separate edition of 
> the OS).
>
> Webrev is here:
> http://cr.openjdk.java.net/~bchristi/7178922/webrev.0/
>
> Note: the setUnknownOSAndVersion() function is unused following my 
> change, so I went ahead and removed it.
>
> Thanks,
> -Brent


-- 
Best regards, Sergey.



More information about the macosx-port-dev mailing list