-
Bug
-
Resolution: Fixed
-
P2
-
7u40
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8131172 | 7u40 | Unassigned | P2 | Closed | Fixed |
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. >>
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. >>
- backported by
-
JDK-8131172 Mac: MacFileNSURL.createFromBookmark() breaks if FileChooser.showOpenDialog() has not been invoked before
- Closed