code simplification

This commit is contained in:
Sebastian Stenzel
2016-12-19 13:57:30 +01:00
parent 97f2cee1ae
commit d6c6f177e8
@@ -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);
}
}
/**