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

Mac: MacFileNSURL.createFromBookmark() breaks if FileChooser.showOpenDialog() has not been invoked before

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 8
    • 7u40
    • javafx

        FileChooser.showOpenDialog() triggers some initializations that are mandatory for MacFileNSURL to work correctly.
        If the application calls MacFileNSURL.createFromBookmark() directly, the jvm crashes.

        Quoting Anthony:

        << Indeed. In MacCommonDialogs._initIDs() (see GlassDialogs.m line 278) we initialize some method IDs for this class and other Java classes. If you've never shown the dialog, they are uninitialized, and hence the JVM could crash when using any of them. And the isFileNSURLEnabled is in fact used in the convertNSURLtoFile() which you ultimately call from createFromBookmark().

        To make sure, you could try and show a file chooser, but after that forget the returned files (or just hit cancel), and actually retrieve a bookmark from an earlier run of this app, and see how it works. I bet it should work fine in this case.

        Please file a JIRA and assign it to me. I'll try to fix this issue tomorrow. >>

              anthony Anthony Petrov (Inactive)
              eleponn Eric Le Ponner
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported: