From 2e7142785751428528a5ab070410b8b33bab9d6d Mon Sep 17 00:00:00 2001
From: Roland Haeder <roland@mxchange.org>
Date: Wed, 9 Sep 2015 10:59:26 +0200
Subject: [PATCH] =?utf8?q?Removed=20no=20longer=20thrown=20exceptions=20Si?=
 =?utf8?q?gned-off-by:Roland=20H=C3=A4der=20<roland@mxchange.org>?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

---
 .../application/PizzaApplication.java         | 61 +++----------------
 .../application/PizzaServiceApplication.java  | 40 ++++--------
 2 files changed, 22 insertions(+), 79 deletions(-)

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<Product> getAvailableProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
+	public Deque<Product> 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<Product> getAllProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
+	public Deque<Product> 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<Category> getAllCategories () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
+	public Deque<Category> 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<Product> getAvailableProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
+	public Iterator<Product> 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<Product> getAllProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
+	public Iterator<Product> 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<Category> getAllCategoriesIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
+	public Iterator<Category> 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<Category> getAllCategories () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
+	public Deque<Category> getAllCategories () {
 		// Unfinished
 		throw new UnsupportedOperationException("Unfinished method.");
 	}
 
 	@Override
-	public Deque<Product> getAllProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
+	public Deque<Product> getAllProducts () {
 		// Unfinished
 		throw new UnsupportedOperationException("Unfinished method.");
 	}
 
 	@Override
-	public Deque<Product> getAvailableProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
+	public Deque<Product> getAvailableProducts () {
 		// Unfinished
 		throw new UnsupportedOperationException("Unfinished method.");
 	}
@@ -93,7 +91,7 @@ public class PizzaServiceApplication extends BaseFrameworkSystem implements Pizz
 
 	@Override
 	@SuppressWarnings ("unchecked")
-	public Iterator<Product> getAvailableProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
+	public Iterator<Product> getAvailableProductsIterator () {
 		// Trace message
 		this.getLogger().trace("CALLED!"); //NOI18N
 
@@ -103,7 +101,7 @@ public class PizzaServiceApplication extends BaseFrameworkSystem implements Pizz
 
 	@Override
 	@SuppressWarnings ("unchecked")
-	public Iterator<Product> getAllProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
+	public Iterator<Product> getAllProductsIterator () {
 		// Trace message
 		this.getLogger().trace("CALLED!"); //NOI18N
 
@@ -113,7 +111,7 @@ public class PizzaServiceApplication extends BaseFrameworkSystem implements Pizz
 
 	@Override
 	@SuppressWarnings ("unchecked")
-	public Iterator<Category> getAllCategoriesIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
+	public Iterator<Category> 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
 
-- 
2.39.5