RFR: 7178922 : (props) re-visit how os.name is determined on Mac
brent.christian at oracle.com
Fri Nov 16 17:32:52 UTC 2012
Any more comments on this?
On 11/14/12 1:23 PM, Brent Christian wrote:
> Thanks, Sergey.
> It's good that we standardized on the recommended usage within the JDK
> in order to stay ahead of a possible change to the value of ProductName
> in /System/Library/CoreServices/SystemVersion.plist
> But we can expect that Java application developers use the same variety
> of OS platform checks. Which is why we should maintain the current
> value (versus risking apps breaking in the event of a change in
> ProductName used by OS X), especially considering that it works fine
> with the recommended osName.contains("OS X").
> As is suggested in the bug report, if the Mac's OS changes so radically
> that we should be reporting a new os.name ("Mac OS XI", or who knows
> what), we will almost certainly need to update the JDK to run on it, at
> which time we can also change the value of os.name.
> On 11/13/12 5:05 PM, Sergey Bylokhov wrote:
>> So many efforts was done to unify this style across the jdk
>> Note that official documentation from apple suggest: contains("OS X")
>> 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:
>>> 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:
>>> Note: the setUnknownOSAndVersion() function is unused following my
>>> change, so I went ahead and removed it.
More information about the core-libs-dev