Review request for JMC-6151:[osx] opening .jfr file on mac fails for first time

Tejpal Rebari tejpal.rebari at oracle.com
Tue Oct 16 18:09:31 UTC 2018


Hi Marcus,
Made the changes according to your instruction,
diff -r 2177c12e7894 application/org.openjdk.jmc.rcp.application/src/main/java/org/openjdk/jmc/rcp/application/actions/OpenFileAction.java
--- a/application/org.openjdk.jmc.rcp.application/src/main/java/org/openjdk/jmc/rcp/application/actions/OpenFileAction.java     Wed Oct 10 15:18:48 2018 +0200
+++ b/application/org.openjdk.jmc.rcp.application/src/main/java/org/openjdk/jmc/rcp/application/actions/OpenFileAction.java     Tue Oct 16 23:30:54 2018 +0530
@@ -47,6 +47,7 @@
 import org.openjdk.jmc.rcp.application.ApplicationPlugin;
 import org.openjdk.jmc.ui.MCPathEditorInput;
 import org.openjdk.jmc.ui.WorkbenchToolkit;
+import org.openjdk.jmc.ui.common.util.Environment;
 
 /**
  * Class for opening a file
@@ -140,7 +141,10 @@
        public static void openFile(IWorkbenchWindow inWindow) {
                FileDialog dialog = new FileDialog(inWindow.getShell(), SWT.OPEN | SWT.MULTI);
                dialog.setFilterPath(getDefaultFilterPath());
-               setFilterNamesAndExtensions(dialog);
+               // FIXME: Workaround for Eclipse bug 540164. See JMC-6171.
+               if (Environment.getOSType() != Environment.OSType.MAC) {
+                       setFilterNamesAndExtensions(dialog);
+               }
                dialog.setText(Messages.OpenFileAction_OPEN_FILE_TITLE);
 
                if (dialog.open() == null) {

Thanks and Regards
Tejpal

> On 16-Oct-2018, at 11:25 PM, Tejpal Rebari <tejpal.rebari at oracle.com> wrote:
> 
> Yes,please push it for me.
> 
> Thanks and regards
> Tejpal 
> 
>> On 16-Oct-2018, at 11:00 PM, Marcus Hirt <marcus.hirt at oracle.com> wrote:
>> 
>> Looks fine, but let’s see if we can get the Eclipse fix earlier than 4.10.
>> Also, perhaps you could add some text to the comment, e.g.:
>> 
>> // FIXME: Workaround for Eclipse bug 540164. See JMC-6171.
>> 
>> Would you like me to push it for you?
>> 
>> Kind regards,
>> Marcus
>> 
>> From: Tejpal Rebari <tejpal.rebari at oracle.com>
>> Date: Tuesday, 16 October 2018 at 19:12
>> To: Marcus Hirt <marcus.hirt at oracle.com>
>> Cc: <jmc-dev at openjdk.java.net>
>> Subject: Review request for JMC-6151:[osx] opening .jfr file on mac fails for first time
>> 
>> Hi all,
>> 
>> Please review the fix for,
>> Jira: https://bugs.openjdk.java.net/browse/JMC-5576
>> webrev: http://cr.openjdk.java.net/~ghb/trebari/JMC-6151/webrev.0/
>> RC : (Mac OSX) FileDialog.setfilterIndex() doesn't work as expected
>> Solution: For Mac OSX disabled the filters extension ,so the file dialog shows all the files that are there in the path.While for other OS it works same as before.
>> Test: Tested on Windows 10, MacOS, Linux.
>> 
>> Thanks,
>> Tejpal
>> 
>> 
> 



More information about the jmc-dev mailing list