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

Unguarded use of displaySyncEnabled causes build to fail

    XMLWordPrintable

    Details

    • Subcomponent:
      2d

      Description

      The addition of displaySyncEnabled in JDK-8232164 gives the following warning when built with Xcode 10.1 and either the macOS 10.13 or 10.14 SDK:

      /Users/kcr/java/lanai/open/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m:100:14: warning: 'setDisplaySyncEnabled:' is only available on macOS 10.13 or newer [-Wunguarded-availability-new]
              self.displaySyncEnabled = NO;
                   ^~~~~~~~~~~~~~~~~~
      /var/tmp/jib-kcr/install/jpg/infra/builddeps/devkit-macosx_x64/Xcode10.1-MacOSX10.14+1.0/devkit-macosx_x64-Xcode10.1-MacOSX10.14+1.0.tar.gz/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAMetalLayer.h:116:16: note: 'setDisplaySyncEnabled:' has been explicitly marked partial here
      @property BOOL displaySyncEnabled API_AVAILABLE(macos(10.13));
                     ^

      This fails the build unless you specify `--disable-warnings-as-errors` since the current deployment target is 10.9 or later. We will need to bump this to 10.13 at some point, but for now the easiest thing to do is to add a runtime check for 10.13 or later.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kcr Kevin Rushforth
              Reporter:
              kcr Kevin Rushforth
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: