From d0ed6a1970842c2e7a19afe1ee664f694d4d4f1a Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 28 Aug 2015 22:57:46 +0200 Subject: [PATCH] =?utf8?q?Removed=20more=20deprecated=20and=20no=20longer?= =?utf8?q?=20used=20methods=20+=20kept=20one=20for=20functionality=20Signe?= =?utf8?q?d-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../application/PizzaApplication.java | 22 -------- .../application/PizzaServiceApplication.java | 53 +------------------ .../beans/controller/PizzaBean.java | 22 -------- .../beans/controller/PizzaServiceBean.java | 26 --------- 4 files changed, 2 insertions(+), 121 deletions(-) diff --git a/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java b/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java index a5483c4d..a017e4de 100644 --- a/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java +++ b/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java @@ -123,28 +123,6 @@ public interface PizzaApplication extends Application { @Deprecated public boolean isProductChoosen (final Product product, final HttpServletRequest request, final HttpSession session); - /** - * Calculates total price of all choosen products - * - * @param request Request instance - * @param session Session instance - * @return Total price of all choosen products - * @throws javax.servlet.ServletException If something unexpected happened - */ - public float calculateTotalPrice (final HttpServletRequest request, final HttpSession session) throws ServletException; - - /** - * Calculates total amount of all choosen products - * - * @param request Request instance - * @param session Session instance - * @return Total amount of all choosen products - * @throws javax.servlet.ServletException If something unexpected happened - * @deprecated Old lost code - */ - @Deprecated - public int calculateTotalAmount (final HttpServletRequest request, final HttpSession session) throws ServletException; - /** * Some "getter" for HTML code 'checked="checked"' if the product is choosen * diff --git a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java index 6e8c4ba5..c125c2e1 100644 --- a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java +++ b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java @@ -99,11 +99,10 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P * @param request Request instance * @param session Session instance * @return Total amount of all choosen products - * @deprecated Old lost code + * @deprecated Old lost */ - @Override @Deprecated - public int calculateTotalAmount (final HttpServletRequest request, final HttpSession session) throws ServletException { + private int calculateTotalAmount (final HttpServletRequest request, final HttpSession session) throws ServletException { // Trace message this.getLogger().trace(MessageFormat.format("request={0},session={1} - CALLED!", request, session)); //NOI18N @@ -147,54 +146,6 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P return totalAmount; } - /** - * Calculates total price of all choosen products - * - * @param request Request instance - * @param session Session instance - * @return Total price of all choosen products - */ - @Override - public float calculateTotalPrice (final HttpServletRequest request, final HttpSession session) throws ServletException { - // Trace message - this.getLogger().trace(MessageFormat.format("request={0},session={1} - CALLED!", request, session)); //NOI18N - - // Is product and session set? - if (null == request) { - // Not set - throw new NullPointerException("request is null"); //NOI18N - } else if (null == session) { - // Not set - throw new NullPointerException("session is null"); //NOI18N - } - - // Init total price - float totalPrice = 0.00f; - - // Get iterator - Iterator iterator = this.getAvailableProducts(); - - // "Walk" over all products - while (iterator.hasNext()) { - // Get next product - Product product = iterator.next(); - - // Is this choosen? - if (this.isProductChoosen(product, request, session)) { - // Then add product's total price - this.getLogger().debug(MessageFormat.format("Calling getTotalPositionPriceFromRequestSession({0},request,session) ...", product.getItemId())); //NOI18N - totalPrice += this.getTotalPositionPriceFromRequestSession(product, request, session); - } - this.getLogger().debug(MessageFormat.format("product={0},totalPrice={1}", product.getItemId(), totalPrice)); //NOI18N - } - - // Trace message - this.getLogger().trace(MessageFormat.format(" totalPrice={0} - EXIT!", totalPrice)); //NOI18N - - // Return total price - return totalPrice; - } - @Override public void doBootstrap () { throw new UnsupportedOperationException("Not supported yet."); //NOI18N diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java index 1608590f..d8621470 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java @@ -89,28 +89,6 @@ public interface PizzaBean extends FrameworkBean { @Deprecated public boolean isProductChoosen (final Product product, final HttpServletRequest request, final HttpSession session); - /** - * Calculates total price of all choosen products - * - * @param request Request instance - * @param session Session instance - * @return Total price of all choosen products - * @throws javax.servlet.ServletException If something unexpected happened - */ - public float calculateTotalPrice (final HttpServletRequest request, final HttpSession session) throws ServletException; - - /** - * Calculates total amount of all choosen products - * - * @param request Request instance - * @param session Session instance - * @return Total amount of all choosen products - * @throws javax.servlet.ServletException If something unexpected happened - * @deprecated Old lost code - */ - @Deprecated - public int calculateTotalAmount (final HttpServletRequest request, final HttpSession session) throws ServletException; - /** * Some "getter" for HTML code 'checked="checked"' if the product is choosen * diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceBean.java b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceBean.java index c7b5fe9f..8ca0429e 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceBean.java @@ -94,32 +94,6 @@ public class PizzaServiceBean extends BaseFrameworkBean implements PizzaBean { } } - /** - * Calculates total amount of all choosen products - * - * @param request Request instance - * @param session Session instance - * @return Total amount of all choosen products - * @deprecated Old lost code - */ - @Override - @Deprecated - public int calculateTotalAmount (final HttpServletRequest request, final HttpSession session) throws ServletException { - return this.app.calculateTotalAmount(request, session); - } - - /** - * Calculates total price of all choosen products - * - * @param request Request instance - * @param session Session instance - * @return Total price of all choosen products - */ - @Override - public float calculateTotalPrice (final HttpServletRequest request, final HttpSession session) throws ServletException { - return this.app.calculateTotalPrice(request, session); - } - /** * Some "getter" for amount from session * -- 2.39.5