On Thu, 11 Feb 2021 17:31:34 GMT, Kevin Rushforth <k...@openjdk.org> wrote:
>> On Mac Os X, the OSVersionTest detected a difference in the version number >> reported in the os.version property >> and the version number provided by `sw_vers -productVersion`. >> >> When the java runtime is built with XCode 11.3, the os.version is reported >> as 10.16 >> though the current version numbering is 11.nnn. >> >> The workaround is to derive the os.version number from the >> ProductBuildVersion. >> When the toolchain is updated to XCode 12.nnn it can be removed. >> The workaround is enabled only when the environment variable >> SYSTEM_VERSION_COMPAT is unset. >> When the SYSTEM_VERSION_COMPAT is set in the environment the version number >> is reported as reported by Mac OS X. > > src/java.base/macosx/native/libjava/java_props_macosx.c line 250: > >> 248: >> 249: NSString *nsVerStr; >> 250: // Copy out the char* if running on version other than >> pre-10.16 Mac OS (10.16 == 11.x) > > Isn't the comment backwards from what the test does? I would think it should > be "if running on version other than 10.16 Mac OS ...". Or am I missing > something? @kevinrushforth I think you are correct. This is actually mea culpa I think as I had provided in a Slack thread a failed attempt at a patch for this which contained this comment. ------------- PR: https://git.openjdk.java.net/jdk/pull/2530