mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-07-29 11:32:38 +00:00
using pattern-matching instanceof where applicable
This commit is contained in:
@@ -42,8 +42,8 @@ public class DefaultSceneFactory implements Function<Parent, Scene> {
|
||||
protected void configureScene(Scene scene) {
|
||||
scene.windowProperty().addListener(observable -> {
|
||||
Window window = scene.getWindow();
|
||||
if (window instanceof Stage) {
|
||||
setupDefaultAccelerators(scene, (Stage) window);
|
||||
if (window instanceof Stage s) {
|
||||
setupDefaultAccelerators(scene, s);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -76,8 +76,8 @@ public class UnlockWorkflow extends Task<Boolean> {
|
||||
|
||||
setOnFailed(event -> {
|
||||
Throwable throwable = event.getSource().getException();
|
||||
if (throwable instanceof InvalidMountPointException) {
|
||||
handleInvalidMountPoint((InvalidMountPointException) throwable);
|
||||
if (throwable instanceof InvalidMountPointException e) {
|
||||
handleInvalidMountPoint(e);
|
||||
} else {
|
||||
handleGenericError(throwable);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user