Sv: [PATCH] JMC-6484 "Recent Files" sub-menu not populated on startup

Marcus Hirt marcus at hirt.se
Sat May 25 00:02:33 UTC 2019


Hi there!

There seem to be other users of that class that use the 
default constructor presumably because they do not want 
to persist their opening of files, such as trigger
actions. One could argue that maybe they should end up 
in the recently opened list too, but I believe this is 
at least the reason for the current behavior.

A slightly more defensive solution could be to instead:

diff -r 4c9efa5eb5b8 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     Fri May 24 13:05:05 2019 +0200
+++ b/application/org.openjdk.jmc.rcp.application/src/main/java/org/openjdk/jmc/rcp/application/actions/OpenFileAction.java     Sat May 25 01:59:12 2019 +0200
@@ -161,7 +161,7 @@
                        for (String name : names) {
                                final File file = new File(filterPath + File.separator + name);
                                if (file.exists()) {
-                                       WorkbenchToolkit.openEditor(inWindow, new MCPathEditorInput(file));
+                                       WorkbenchToolkit.openEditor(inWindow, new MCPathEditorInput(file, true));
                                } else {
                                        if (++numberOfFilesNotFound > 1) {
                                                notFound.append('\n'); 

Kind regards,
Marcus

-----Ursprungligt meddelande-----
Från: jmc-dev <jmc-dev-bounces at openjdk.java.net> För Kangcheng Xu
Skickat: den 22 maj 2019 17:09
Till: jmc-dev at openjdk.java.net
Ämne: [PATCH] JMC-6484 "Recent Files" sub-menu not populated on startup

Hello,

This patch fixes JMC-6484 "Recent Files" sub-menu not populated on startup [0]. It is a simple fix and only one line is changed to mark MCPathEditorInput persistable, and therefore, is written to persistent storage by a memento.

Please see the attached patch. Thank you very much!

[0]
https://bugs.openjdk.java.net/browse/JMC-6484



More information about the jmc-dev mailing list