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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 7u40
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:

      Backports

        Description

        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. >>

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported: