Apply suggestions from code review

Co-authored-by: Sebastian Stenzel <overheadhunter@users.noreply.github.com>
This commit is contained in:
Armin Schrenk
2023-05-09 09:42:01 +02:00
committed by GitHub
parent 6386dd3d50
commit ff80f634d2
3 changed files with 11 additions and 12 deletions

View File

@@ -6,9 +6,8 @@ public interface IpcMessageListener {
default void handleMessage(IpcMessage message) {
switch (message) {
case RevealRunningAppMessage x -> revealRunningApp();
case HandleLaunchArgsMessage hlam -> handleLaunchArgs(hlam.args());
default -> {}
case RevealRunningAppMessage m -> revealRunningApp(); // TODO: rename to _ with JEP 443
case HandleLaunchArgsMessage m -> handleLaunchArgs(m.args());
}
}

View File

@@ -91,10 +91,10 @@ public class AwtTrayMenuController implements TrayMenuController {
menuItem.setEnabled(a.enabled());
menu.add(menuItem);
}
case SeparatorItem si -> menu.addSeparator();
case SubMenuItem smi -> {
var submenu = new Menu(smi.title());
addChildren(submenu, smi.items());
case SeparatorItem s -> menu.addSeparator(); // TODO: rename to _ with JEP 443
case SubMenuItem s -> {
var submenu = new Menu(s.title());
addChildren(submenu, s.items());
menu.add(submenu);
}
}

View File

@@ -38,12 +38,12 @@ public class UnlockInvalidMountPointController implements FxController {
@FXML
public void initialize() {
var e = unlockException.get();
var translationKeySuffix = switch (e) {
case MountPointNotSupportedException x -> "notSupported";
case MountPointNotExistsException x -> "notExists";
default -> "generic";
var translationKey = switch (e) {
case MountPointNotSupportedException x -> "unlock.error.customPath.description.notSupported";
case MountPointNotExistsException x -> "unlock.error.customPath.description.notExists";
default -> "unlock.error.customPath.description.generic";
};
dialogDescription.setFormat(resourceBundle.getString("unlock.error.customPath.description." + translationKeySuffix));
dialogDescription.setFormat(resourceBundle.getString(translationKey));
dialogDescription.setArg1(e.getMessage());
}