mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-08-18 05:06:02 +00:00
code simplification
This commit is contained in:
+6
-8
@@ -72,14 +72,12 @@ abstract class AbstractFXMLViewController implements Initializable {
|
||||
* @return Parent view element.
|
||||
*/
|
||||
protected final Parent loadFxml() {
|
||||
return LazyInitializer.initializeLazily(fxmlRoot, () -> {
|
||||
final FXMLLoader loader = createFxmlLoader();
|
||||
try {
|
||||
return loader.load();
|
||||
} catch (IOException e) {
|
||||
throw new IllegalStateException("Could not load FXML file from location: " + loader.getLocation(), e);
|
||||
}
|
||||
});
|
||||
final FXMLLoader loader = createFxmlLoader();
|
||||
try {
|
||||
return LazyInitializer.initializeLazily(fxmlRoot, loader::load, IOException.class);
|
||||
} catch (IOException e) {
|
||||
throw new IllegalStateException("Could not load FXML file from location: " + loader.getLocation(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user