Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8342647

[macosx] Clean up the NSInvocation based call to NSProcessInfo.operatingSystemVersion

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • None
    • core-libs
    • b24
    • os_x

      The src/java.base/macosx/native/libjava/java_props_macosx.c in its setOSNameAndVersion function, in order to determine the current version of macosx, invokes the NSProcessInfo.operatingSystemVersion property. NSProcessInfo.operatingSystemVersion is an API provided by macosx through its Foundation framework https://developer.apple.com/documentation/foundation/nsprocessinfo. As noted in the documentation of NSProcessInfo.operatingSystemVersion, this property is available, for static reference, since macosx 10.10 https://developer.apple.com/documentation/foundation/nsprocessinfo/1410906-operatingsystemversion.

      The current code in JDK's java_props_macosx.c calls the NSProcessInfo.operatingSystemVersion dynamically (reflection style) through the use of NSInvocation API because this property wasn't available for static access in macosx 10.9.

      The current JDK mainline, at build time and runtime, expects macosx versions to be higher than 10.x, so replacing the NSInvocation call with a static reference to NSProcessInfo.operatingSystemVersion would clean up these few lines in java_props_macosx.c.

            jpai Jaikiran Pai
            jpai Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: