From: Roland Haeder Date: Wed, 9 Sep 2015 08:59:26 +0000 (+0200) Subject: Removed no longer thrown exceptions X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2e7142785751428528a5ab070410b8b33bab9d6d;p=pizzaservice-swing.git Removed no longer thrown exceptions Signed-off-by:Roland Häder --- diff --git a/src/org/mxchange/pizzaapplication/application/PizzaApplication.java b/src/org/mxchange/pizzaapplication/application/PizzaApplication.java index 29658f6..e412d49 100644 --- a/src/org/mxchange/pizzaapplication/application/PizzaApplication.java +++ b/src/org/mxchange/pizzaapplication/application/PizzaApplication.java @@ -17,7 +17,6 @@ package org.mxchange.pizzaapplication.application; import java.io.IOException; -import java.lang.reflect.InvocationTargetException; import java.sql.SQLException; import java.util.Deque; import java.util.Iterator; @@ -36,37 +35,22 @@ public interface PizzaApplication extends Application { * Some "getter" for a linked list of only available products * * @return Only available products - * @throws java.io.IOException If an IO error occurs - * @throws java.sql.SQLException If an SQL error occurs - * @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? */ - public Deque getAvailableProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public Deque getAvailableProducts (); /** * Some "getter" for a linked list of all products * * @return All products - * @throws java.io.IOException If an IO error occurs - * @throws java.sql.SQLException If an SQL error occurs - * @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? */ - public Deque getAllProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public Deque getAllProducts (); /** * Some "getter" for a linked list of all categories * * @return All categories - * @throws java.io.IOException If an IO error occurs - * @throws java.sql.SQLException If an SQL error occurs - * @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? */ - public Deque getAllCategories () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public Deque getAllCategories (); /** * Initializes this instance with given ServletContext @@ -80,61 +64,36 @@ public interface PizzaApplication extends Application { * Some "getter" for a an array of only available products * * @return Only available products - * @throws java.io.IOException If an IO error occurs - * @throws java.sql.SQLException If an SQL error occurs - * @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? */ - public Iterator getAvailableProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public Iterator getAvailableProductsIterator (); /** * Some "getter" for a an array of all products * * @return All products - * @throws java.io.IOException If an IO error occurs - * @throws java.sql.SQLException If an SQL error occurs - * @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? */ - public Iterator getAllProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public Iterator getAllProductsIterator (); /** * Some "getter" for a an array of all categories * * @return All categories - * @throws java.io.IOException If an IO error occurs - * @throws java.sql.SQLException If an SQL error occurs - * @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? */ - public Iterator getAllCategoriesIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public Iterator getAllCategoriesIterator (); /** * Adds given category data from request to database * * @param category Category instance - * @throws org.mxchange.jshopcore.exceptions.CategoryTitleAlreadyUsedException The category's title is already used - * @throws java.io.IOException If an IO error occurs - * @throws java.sql.SQLException If an SQL error occurs - * @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.jshopcore.exceptions.CategoryTitleAlreadyUsedException If the category's title has been used */ - public void doAdminAddCategory (final Category category) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException; + public void doAdminAddCategory (final Category category) throws CategoryTitleAlreadyUsedException; /** * Adds given product data from request to database * * @param product Product instance - * @throws java.io.IOException If an IO error occurs - * @throws java.sql.SQLException If an SQL error occurs - * @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.jshopcore.exceptions.ProductTitleAlreadyUsedException If the product's title is already used + * @throws org.mxchange.jshopcore.exceptions.ProductTitleAlreadyUsedException If the product's title has been used */ - public void doAdminAddProduct (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException; + public void doAdminAddProduct (final Product product) throws ProductTitleAlreadyUsedException; } diff --git a/src/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java b/src/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java index e469a33..6b7ff82 100644 --- a/src/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java +++ b/src/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java @@ -16,8 +16,6 @@ */ package org.mxchange.pizzaapplication.application; -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; import java.sql.SQLException; import java.text.MessageFormat; import java.util.Deque; @@ -43,19 +41,19 @@ public class PizzaServiceApplication extends BaseFrameworkSystem implements Pizz } @Override - public Deque getAllCategories () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + public Deque getAllCategories () { // Unfinished throw new UnsupportedOperationException("Unfinished method."); } @Override - public Deque getAllProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + public Deque getAllProducts () { // Unfinished throw new UnsupportedOperationException("Unfinished method."); } @Override - public Deque getAvailableProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + public Deque getAvailableProducts () { // Unfinished throw new UnsupportedOperationException("Unfinished method."); } @@ -93,7 +91,7 @@ public class PizzaServiceApplication extends BaseFrameworkSystem implements Pizz @Override @SuppressWarnings ("unchecked") - public Iterator getAvailableProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + public Iterator getAvailableProductsIterator () { // Trace message this.getLogger().trace("CALLED!"); //NOI18N @@ -103,7 +101,7 @@ public class PizzaServiceApplication extends BaseFrameworkSystem implements Pizz @Override @SuppressWarnings ("unchecked") - public Iterator getAllProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + public Iterator getAllProductsIterator () { // Trace message this.getLogger().trace("CALLED!"); //NOI18N @@ -113,7 +111,7 @@ public class PizzaServiceApplication extends BaseFrameworkSystem implements Pizz @Override @SuppressWarnings ("unchecked") - public Iterator getAllCategoriesIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + public Iterator getAllCategoriesIterator () { // Trace message this.getLogger().trace("CALLED!"); //NOI18N @@ -127,7 +125,7 @@ public class PizzaServiceApplication extends BaseFrameworkSystem implements Pizz * @param title Title of category to check * @return Whether it has been found */ - private boolean isCategoryTitleUsed(final String title) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + private boolean isCategoryTitleUsed(final String title) { // Trace message this.getLogger().trace("title=" + title + " - CALLED!"); //NOI18N @@ -136,7 +134,7 @@ public class PizzaServiceApplication extends BaseFrameworkSystem implements Pizz } @Override - public void doAdminAddCategory (final Category category) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException { + public void doAdminAddCategory (final Category category) throws CategoryTitleAlreadyUsedException { // Trace message this.getLogger().trace(MessageFormat.format("category={0} - CALLED!", category)); //NOI18N @@ -169,7 +167,7 @@ public class PizzaServiceApplication extends BaseFrameworkSystem implements Pizz } // Try to check if title is used already - if (this.isCategoryTitleUsed(title)) { + if (this.isCategoryTitleUsed(category)) { // Title already used throw new CategoryTitleAlreadyUsedException(category); } @@ -182,7 +180,7 @@ public class PizzaServiceApplication extends BaseFrameworkSystem implements Pizz } @Override - public void doAdminAddProduct (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException { + public void doAdminAddProduct (final Product product) throws ProductTitleAlreadyUsedException { // Trace message this.getLogger().trace(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N @@ -240,15 +238,8 @@ public class PizzaServiceApplication extends BaseFrameworkSystem implements Pizz * * @param product Product instance * @return Whether the product title is already used - * @throws java.io.IOException If any IO error occurs - * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found in a file-based database backend's file ... ;-) - * @throws java.sql.SQLException If any SQL error occurs - * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged - * @throws java.lang.NoSuchMethodException If a method was not found - * @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, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + private boolean isProductTitleUsed (final Product product) { // Trace message this.getLogger().trace(MessageFormat.format("category={0} - CALLED!", product)); //NOI18N @@ -283,15 +274,8 @@ public class PizzaServiceApplication extends BaseFrameworkSystem implements Pizz * * @param category Category instance * @return Whether the product title is already used - * @throws java.io.IOException If any IO error occurs - * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found in a file-based database backend's file ... ;-) - * @throws java.sql.SQLException If any SQL error occurs - * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged - * @throws java.lang.NoSuchMethodException If a method was not found - * @throws java.lang.IllegalAccessException If the method cannot be accessed - * @throws java.lang.reflect.InvocationTargetException Any other problems? */ - private boolean isCategoryTitleUsed (final Category category) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + private boolean isCategoryTitleUsed (final Category category) { // Trace message this.getLogger().trace(MessageFormat.format("category={0} - CALLED!", category)); //NOI18N