diff --git a/gui/src/main/java/io/bitsquare/gui/common/ViewFxException1.java b/gui/src/main/java/io/bitsquare/gui/common/ViewFxException1.java deleted file mode 100644 index fd36f7ab9b..0000000000 --- a/gui/src/main/java/io/bitsquare/gui/common/ViewFxException1.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of Bitsquare. - * - * Bitsquare is free software: you can redistribute it and/or modify it - * under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * Bitsquare is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public - * License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Bitsquare. If not, see . - */ - -package io.bitsquare.gui.common; - -import static java.lang.String.format; - -public class ViewFxException1 extends RuntimeException { - - private static final long serialVersionUID = -6266047448442595372L; - - public ViewFxException1(Throwable cause, String format, Object... args) { - super(format(format, args), cause); - } - - public ViewFxException1(String format, Object... args) { - super(format(format, args)); - } -} diff --git a/gui/src/main/java/io/bitsquare/gui/common/fxml/FxmlViewLoader.java b/gui/src/main/java/io/bitsquare/gui/common/fxml/FxmlViewLoader.java index 9508a238a3..f24fb86962 100644 --- a/gui/src/main/java/io/bitsquare/gui/common/fxml/FxmlViewLoader.java +++ b/gui/src/main/java/io/bitsquare/gui/common/fxml/FxmlViewLoader.java @@ -17,7 +17,7 @@ package io.bitsquare.gui.common.fxml; -import io.bitsquare.gui.common.ViewFxException; +import io.bitsquare.gui.common.ViewfxException; import io.bitsquare.gui.common.view.FxmlView; import io.bitsquare.gui.common.view.View; import io.bitsquare.gui.common.view.ViewFactory; @@ -76,13 +76,13 @@ public class FxmlViewLoader implements ViewLoader { URL fxmlUrl = viewClass.getClassLoader().getResource(resolvedLocation); if (fxmlUrl == null) - throw new ViewFxException( + throw new ViewfxException( "Failed to load view class [%s] because FXML file at [%s] could not be loaded " + "as a classpath resource. Does it exist?", viewClass, specifiedLocation); return loadFromFxml(fxmlUrl); } catch (InstantiationException | IllegalAccessException ex) { - throw new ViewFxException(ex, "Failed to load view from class %s", viewClass); + throw new ViewfxException(ex, "Failed to load view from class %s", viewClass); } } @@ -94,14 +94,14 @@ public class FxmlViewLoader implements ViewLoader { loader.load(); Object controller = loader.getController(); if (controller == null) - throw new ViewFxException("Failed to load view from FXML file at [%s]. " + + throw new ViewfxException("Failed to load view from FXML file at [%s]. " + "Does it declare an fx:controller attribute?", fxmlUrl); if (!(controller instanceof View)) - throw new ViewFxException("Controller of type [%s] loaded from FXML file at [%s] " + + throw new ViewfxException("Controller of type [%s] loaded from FXML file at [%s] " + "does not implement [%s] as expected.", controller.getClass(), fxmlUrl, View.class); return (View) controller; } catch (IOException ex) { - throw new ViewFxException(ex, "Failed to load view from FXML file at [%s]", fxmlUrl); + throw new ViewfxException(ex, "Failed to load view from FXML file at [%s]", fxmlUrl); } } diff --git a/gui/src/test/java/io/bitsquare/common/fxml/FxmlViewLoaderTests.java b/gui/src/test/java/io/bitsquare/common/fxml/FxmlViewLoaderTests.java index 1424259f43..01b51ead67 100644 --- a/gui/src/test/java/io/bitsquare/common/fxml/FxmlViewLoaderTests.java +++ b/gui/src/test/java/io/bitsquare/common/fxml/FxmlViewLoaderTests.java @@ -17,7 +17,7 @@ package io.bitsquare.common.fxml; -import io.bitsquare.gui.common.ViewFxException; +import io.bitsquare.gui.common.ViewfxException; import io.bitsquare.gui.common.fxml.FxmlViewLoader; import io.bitsquare.gui.common.view.*; import javafx.fxml.LoadException; @@ -70,7 +70,7 @@ public class FxmlViewLoaderTests { @Test public void fxmlFileMissingFxControllerAttributeShouldThrow() { - thrown.expect(ViewFxException.class); + thrown.expect(ViewfxException.class); thrown.expectMessage("Does it declare an fx:controller attribute?"); viewLoader.load(MissingFxController.class); } @@ -93,7 +93,7 @@ public class FxmlViewLoaderTests { @Test public void malformedFxmlFileShouldThrow() { - thrown.expect(ViewFxException.class); + thrown.expect(ViewfxException.class); thrown.expectMessage("Failed to load view from FXML file"); thrown.expectCause(instanceOf(LoadException.class)); viewLoader.load(Malformed.class); @@ -106,7 +106,7 @@ public class FxmlViewLoaderTests { @Test public void missingFxmlFileShouldThrow() { - thrown.expect(ViewFxException.class); + thrown.expect(ViewfxException.class); thrown.expectMessage("Does it exist?"); viewLoader.load(MissingFxmlFile.class); } @@ -118,7 +118,7 @@ public class FxmlViewLoaderTests { @Test public void customFxmlFileLocationShouldOverrideDefaultConvention() { - thrown.expect(ViewFxException.class); + thrown.expect(ViewfxException.class); thrown.expectMessage("Failed to load view class"); thrown.expectMessage("CustomLocation"); thrown.expectMessage("[unconventionally/located.fxml] could not be loaded");