From 53077f0dcd95735c3cc1c0dc886682f50e42c8fc Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 4 Sep 2015 17:03:57 +0200 Subject: [PATCH] =?utf8?q?More=20cleanup=20from=20TDGP=20Signed-off-by:Rol?= =?utf8?q?and=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../application/PizzaApplication.java | 55 +++++-------------- .../application/PizzaServiceApplication.java | 37 ++++++------- 2 files changed, 30 insertions(+), 62 deletions(-) diff --git a/src/org/mxchange/pizzaapplication/application/PizzaApplication.java b/src/org/mxchange/pizzaapplication/application/PizzaApplication.java index c940165..53ec1d4 100644 --- a/src/org/mxchange/pizzaapplication/application/PizzaApplication.java +++ b/src/org/mxchange/pizzaapplication/application/PizzaApplication.java @@ -22,9 +22,6 @@ import java.sql.SQLException; import java.util.Deque; import java.util.Iterator; import org.mxchange.jcore.application.Application; -import org.mxchange.jcore.exceptions.BadTokenException; -import org.mxchange.jcore.exceptions.CorruptedDatabaseFileException; -import org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException; import org.mxchange.jshop.category.Category; import org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException; import org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException; @@ -45,10 +42,8 @@ public interface PizzaApplication extends Application { * @throws java.lang.NoSuchMethodException If a method was not found * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly * @throws java.lang.reflect.InvocationTargetException If something else happens? - * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found - * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged */ - public Deque getAvailableProducts () throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public Deque getAvailableProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; /** * Some "getter" for a linked list of all products @@ -59,10 +54,8 @@ public interface PizzaApplication extends Application { * @throws java.lang.NoSuchMethodException If a method was not found * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly * @throws java.lang.reflect.InvocationTargetException If something else happens? - * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found - * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged */ - public Deque getAllProducts () throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public Deque getAllProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; /** * Some "getter" for a linked list of all categories @@ -73,20 +66,16 @@ public interface PizzaApplication extends Application { * @throws java.lang.NoSuchMethodException If a method was not found * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly * @throws java.lang.reflect.InvocationTargetException If something else happens? - * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found - * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged */ - public Deque getAllCategories () throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public Deque getAllCategories () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; /** * Initializes this instance with given ServletContext * - * @throws org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException If the backend is unsupported * @throws java.sql.SQLException If an SQL error occurs * @throws java.io.IOException If an IO error occurs - * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found */ - public void init () throws UnsupportedDatabaseBackendException, SQLException, IOException, BadTokenException; + public void init () throws SQLException, IOException; /** * Some "getter" for a an array of only available products @@ -97,10 +86,8 @@ public interface PizzaApplication extends Application { * @throws java.lang.NoSuchMethodException If a method was not found * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly * @throws java.lang.reflect.InvocationTargetException If something else happens? - * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found - * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged */ - public Iterator getAvailableProductsIterator () throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public Iterator getAvailableProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; /** * Some "getter" for a an array of all products @@ -111,10 +98,8 @@ public interface PizzaApplication extends Application { * @throws java.lang.NoSuchMethodException If a method was not found * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly * @throws java.lang.reflect.InvocationTargetException If something else happens? - * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found - * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged */ - public Iterator getAllProductsIterator () throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public Iterator getAllProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; /** * Some "getter" for a an array of all categories @@ -125,10 +110,8 @@ public interface PizzaApplication extends Application { * @throws java.lang.NoSuchMethodException If a method was not found * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly * @throws java.lang.reflect.InvocationTargetException If something else happens? - * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found - * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged */ - public Iterator getAllCategoriesIterator () throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public Iterator getAllCategoriesIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; /** * Generates a link for category's parent category. If none is given, the method will return only a small @@ -162,12 +145,10 @@ public interface PizzaApplication extends Application { * @throws java.lang.NoSuchMethodException If a method was not found * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly * @throws java.lang.reflect.InvocationTargetException If something else happens? - * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found - * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged * @deprecated Old lost code */ @Deprecated - public String getPrintableProductCategory (final Product product) throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public String getPrintableProductCategory (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; /** * Adds given category data from request to database @@ -179,10 +160,8 @@ public interface PizzaApplication extends Application { * @throws java.lang.NoSuchMethodException If a method was not found * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly * @throws java.lang.reflect.InvocationTargetException If something else happens? - * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found - * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged */ - public void doAdminAddCategory (final Category category) throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException; + public void doAdminAddCategory (final Category category) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException; /** * Adds given product data from request to database @@ -193,11 +172,9 @@ public interface PizzaApplication extends Application { * @throws java.lang.NoSuchMethodException If a method was not found * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly * @throws java.lang.reflect.InvocationTargetException If something else happens? - * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found - * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged * @throws org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException If the product's title is already used */ - public void doAdminAddProduct (final Product product) throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException; + public void doAdminAddProduct (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException; /** * Handles admin product form requests @@ -207,13 +184,11 @@ public interface PizzaApplication extends Application { * @throws java.lang.NoSuchMethodException If a method was not found * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly * @throws java.lang.reflect.InvocationTargetException If something else happens? - * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found - * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged * @throws org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException If the product's title is already used * @deprecated Old lost code */ @Deprecated - public void doAdminHandleProductForms () throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException; + public void doAdminHandleProductForms () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException; /** * Handles admin category form requests @@ -223,13 +198,11 @@ public interface PizzaApplication extends Application { * @throws java.lang.NoSuchMethodException If a method was not found * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly * @throws java.lang.reflect.InvocationTargetException If something else happens? - * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found - * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged * @throws org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException The category's title is already used * @deprecated Old lost code */ @Deprecated - public void doAdminHandleCategoryForms () throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException; + public void doAdminHandleCategoryForms () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException; /** * Some "getter" for a Product instance from given item @@ -241,8 +214,6 @@ public interface PizzaApplication extends Application { * @throws java.lang.NoSuchMethodException If a method was not found * @throws java.lang.IllegalAccessException If the method cannot be accessed publicly * @throws java.lang.reflect.InvocationTargetException If something else happens? - * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found - * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged */ - public Product getProduct (final AddableBasketItem item) throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public Product getProduct (final AddableBasketItem item) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; } diff --git a/src/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java b/src/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java index 25fc401..cb72f90 100644 --- a/src/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java +++ b/src/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java @@ -22,9 +22,6 @@ import java.sql.SQLException; import java.text.MessageFormat; import java.util.Deque; import java.util.Iterator; -import org.mxchange.jcore.exceptions.BadTokenException; -import org.mxchange.jcore.exceptions.CorruptedDatabaseFileException; -import org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException; import org.mxchange.jshop.category.Category; import org.mxchange.jshop.database.frontend.category.CategoryDatabaseFrontend; import org.mxchange.jshop.database.frontend.category.CategoryFrontend; @@ -61,25 +58,25 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P } @Override - public Deque getAllCategories () throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + public Deque getAllCategories () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Deligate to frontend return this.categoryFrontend.getAllCategories(); } @Override - public Deque getAllProducts () throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + public Deque getAllProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Deligate to frontend return this.productFrontend.getAllProducts(); } @Override - public Deque getAvailableProducts () throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + public Deque getAvailableProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Deligate to frontend return this.productFrontend.getAllAvailableProducts(); } @Override - public void init () throws UnsupportedDatabaseBackendException, SQLException { + public void init () throws SQLException { // Trace message this.getLogger().trace("CALLED!"); //NOI18N @@ -136,7 +133,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P @Override @SuppressWarnings ("unchecked") - public Iterator getAvailableProductsIterator () throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + public Iterator getAvailableProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // categoryFrontend must be set if (null == this.productFrontend) { // Abort here @@ -149,7 +146,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P @Override @SuppressWarnings ("unchecked") - public Iterator getAllProductsIterator () throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + public Iterator getAllProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Trace message this.getLogger().trace("CALLED!"); //NOI18N @@ -165,7 +162,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P @Override @SuppressWarnings ("unchecked") - public Iterator getAllCategoriesIterator () throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + public Iterator getAllCategoriesIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Trace message this.getLogger().trace("CALLED!"); //NOI18N @@ -182,7 +179,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P /** * Initializes database frontends. */ - private void initDatabaseFrontends () throws UnsupportedDatabaseBackendException, SQLException { + private void initDatabaseFrontends () throws SQLException { // Trace message this.getLogger().trace("CALLED!"); //NOI18N @@ -202,7 +199,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P * @param category Category instance * @return Whether it has been found */ - private boolean isCategoryTitleUsed(final Category category) throws IOException, SQLException, BadTokenException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + private boolean isCategoryTitleUsed(final Category category) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { // categoryFrontend must be set if (null == this.categoryFrontend) { // Abort here @@ -218,7 +215,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P * @param title Product title to check * @return Whether the product title has already been used */ - private boolean isProductTitleUsed (final String title) throws IOException, SQLException, BadTokenException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + private boolean isProductTitleUsed (final String title) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { // categoryFrontend must be set if (null == this.productFrontend) { // Abort here @@ -230,7 +227,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P } @Override - public void doAdminAddCategory (final Category category) throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException { + public void doAdminAddCategory (final Category category) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException { // Trace message this.getLogger().trace(MessageFormat.format("category={0} - CALLED!", category)); //NOI18N @@ -273,7 +270,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P } @Override - public void doAdminAddProduct (final Product product) throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException { + public void doAdminAddProduct (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException { // Trace message this.getLogger().trace(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N @@ -350,7 +347,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P @Override @Deprecated - public String getPrintableProductCategory (final Product product) throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + public String getPrintableProductCategory (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Trace message this.getLogger().trace(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N @@ -392,7 +389,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P * @throws java.lang.IllegalAccessException If the method cannot be accessed * @throws java.lang.reflect.InvocationTargetException Any other problems? */ - private boolean isProductTitleUsed (final Product product) throws IOException, SQLException, BadTokenException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + private boolean isProductTitleUsed (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { // Trace message this.getLogger().trace(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N @@ -425,20 +422,20 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P @Override @Deprecated - public void doAdminHandleProductForms () throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException { + public void doAdminHandleProductForms () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException { // Deprecated method called throw new UnsupportedOperationException("Deprecated method has been called."); } @Override @Deprecated - public void doAdminHandleCategoryForms () throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException { + public void doAdminHandleCategoryForms () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException { // Deprecated method called throw new UnsupportedOperationException("Deprecated method has been called."); } @Override - public Product getProduct (final AddableBasketItem item) throws IOException, BadTokenException, SQLException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + public Product getProduct (final AddableBasketItem item) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Trace message this.getLogger().trace(MessageFormat.format("item={0} - CALLED!", item)); //NOI18N -- 2.39.5