From 23414906c8b83bcbe12e82c3aafecf587e8033fc Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 28 Aug 2015 22:59:50 +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 | 44 --------- .../application/PizzaServiceApplication.java | 92 +------------------ .../beans/controller/PizzaBean.java | 42 --------- .../beans/controller/PizzaServiceBean.java | 53 ----------- 4 files changed, 2 insertions(+), 229 deletions(-) diff --git a/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java b/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java index a017e4de..38ecddb5 100644 --- a/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java +++ b/src/java/org/mxchange/pizzaapplication/application/PizzaApplication.java @@ -65,41 +65,6 @@ public interface PizzaApplication extends Application { @Deprecated static final String HTTP_PARAM_MASK = "%s[%s]"; //NOI18N - /** - * Some "getter" for amount from session - * - * @param product Product instance - * @param session Session instance - * @return Amount as string - * @deprecated Old code - */ - @Deprecated - public String getAmountFromSession (final Product product, final HttpSession session); - - /** - * Some "getter" for choose from session - * - * @param product Product instance - * @param session Session instance - * @return Choose as string - * @deprecated Old code - */ - @Deprecated - public String getChooseFromSession (final Product product, final HttpSession session); - - /** - * Some "getter" for total price of position from request or session. - * Single price and amount is multiplyed. - * - * @param product Product instance - * @param request Request instance - * @param session Session instance - * @return Amount as string - * @deprecated Old code - */ - @Deprecated - public float getTotalPositionPriceFromRequestSession (final Product product, final HttpServletRequest request, final HttpSession session); - /** * Initializes this instance with given ServletContext * @@ -143,15 +108,6 @@ public interface PizzaApplication extends Application { */ public String getDisabledHtmlFromSession (final HttpServletRequest request, final HttpSession session) throws ServletException; - /** - * Some getter for printable value from session or an empty string for null. - * - * @param session Session instance - * @param key Key to get - * @return Value from key, empty string for null - */ - public Object getPrintableValeFromSession (final HttpSession session, final String key); - /** * Somewhat setter in session * diff --git a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java index c125c2e1..a542e56a 100644 --- a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java +++ b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java @@ -167,10 +167,10 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P * @param product Product instance * @param session Session instance * @return Amount as string + * @deprecated Old lost code */ - @Override @Deprecated - public String getAmountFromSession (final Product product, final HttpSession session) { + private String getAmountFromSession (final Product product, final HttpSession session) { // Trace message this.getLogger().trace(MessageFormat.format("product={0},session={1} - CALLED!", product, session)); //NOI18N @@ -243,45 +243,6 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P } } - /** - * Some "getter" for choose from session - * - * @param product Product instance - * @param session Session instance - * @return Choose as string - */ - @Override - @Deprecated - public String getChooseFromSession (final Product product, final HttpSession session) { - // Trace message - this.getLogger().trace(MessageFormat.format("product={0},session={1} - CALLED!", product, session)); //NOI18N - - // Is product and session set? - if (null == product) { - // Not set - throw new NullPointerException("product is null"); //NOI18N - } else if (null == session) { - // Not set - throw new NullPointerException("session is null"); //NOI18N - } - - // Get attribute - Object object = this.getValueFromSession(product, session, HTTP_PARAM_ITEM_ID); - - // Is the object null? - if (null == object) { - // Not found - this.getLogger().debug(MessageFormat.format("Returning empty string for product={0} ...", product.getItemId())); //NOI18N - return ""; //NOI18N - } - - // Trace message - this.getLogger().trace(MessageFormat.format("object={0} - CALLED!", object)); //NOI18N - - // Cast to string and return it - return (String) object; - } - /** * Some "getter" for HTML code 'disabled="disabled"' for e.g. submit buttons * @@ -353,40 +314,6 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P } } - /** - * Some getter for printable value from session or an empty string for null. - * - * @param session Session instance - * @param key Key to get - * @return Value from key, empty string for null - */ - @Override - public Object getPrintableValeFromSession (final HttpSession session, final String key) { - // Trace message - this.getLogger().trace(MessageFormat.format("session={0},key={1} - CALLED", session, key)); //NOI18N - - // Are both parameter not null? - if (null == session) { - // Abort here - throw new NullPointerException("session is null"); //NOI18N - } else if (null == key) { - // Abort here - throw new NullPointerException("key is null"); //NOI18N - } - - // Now get it - Object value = this.getValueFromSession(session, key); - - // Debug message - this.getLogger().debug(MessageFormat.format("value={0}", value)); //NOI18N - - // Trace message - this.getLogger().trace(MessageFormat.format("Calling this.convertNullToEmpty({0}) ... - EXIT!", value)); //NOI18N - - // Return actual value - return this.convertNullToEmpty(value); - } - /** * Some "getter" for a an array of only available products * @@ -456,21 +383,6 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P } } - /** - * Some "getter" for total price of position from request or session. - * Single price and amount is multiplyed. - * - * @param product Product instance - * @param request Request instance - * @param session Session instance - * @return Amount as string - */ - @Override - @Deprecated - public float getTotalPositionPriceFromRequestSession (final Product product, final HttpServletRequest request, final HttpSession session) { - throw new UnsupportedOperationException("This method is deprecated and shall not be called."); - } - /** * Checks whether the given product is choosen, request overules session. * diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java index d8621470..1fc01c60 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaBean.java @@ -37,39 +37,6 @@ import org.mxchange.jshop.product.Product; * @author Roland Haeder */ public interface PizzaBean extends FrameworkBean { - /** - * Some "getter" for amount from session - * - * @param product Product instance - * @param session Session instance - * @return Amount as string - * @deprecated Old code - */ - @Deprecated - public String getAmountFromSession (final Product product, final HttpSession session); - - /** - * Some "getter" for choose from session - * - * @param product Product instance - * @param session Session instance - * @return Choose as string - * @deprecated Old code - */ - @Deprecated - public String getChooseFromSession (final Product product, final HttpSession session); - - /** - * Some "getter" for total price of position from request or session. - * Single price and amount is multiplyed. - * - * @param product Product instance - * @param request Request instance - * @param session Session instance - * @return Amount as string - */ - public float getTotalPositionPriceFromRequestSession (final Product product, final HttpServletRequest request, final HttpSession session); - /** * Initializes this instance * @@ -109,15 +76,6 @@ public interface PizzaBean extends FrameworkBean { */ public String getDisabledHtmlFromSession (final HttpServletRequest request, final HttpSession session) throws ServletException; - /** - * Some getter for printable value from session or an empty string for null. - * - * @param session Session instance - * @param key Key to get - * @return Value from key, empty string for null - */ - public Object getPrintableValeFromSession (final HttpSession session, final String key); - /** * Somewhat setter in session * diff --git a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceBean.java b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceBean.java index 8ca0429e..b5e5f205 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/controller/PizzaServiceBean.java @@ -94,19 +94,6 @@ public class PizzaServiceBean extends BaseFrameworkBean implements PizzaBean { } } - /** - * Some "getter" for amount from session - * - * @param product Product instance - * @param session Session instance - * @return Amount as string - */ - @Override - @Deprecated - public String getAmountFromSession (final Product product, final HttpSession session) { - return this.app.getAmountFromSession(product, session); - } - /** * Some "getter" for HTML code 'checked="checked"' if the product is choosen * @@ -120,19 +107,6 @@ public class PizzaServiceBean extends BaseFrameworkBean implements PizzaBean { return this.app.getCheckedHtmlFromProduct(product, request, session); } - /** - * Some "getter" for choose from session - * - * @param product Product instance - * @param session Session instance - * @return Choose as string - */ - @Override - @Deprecated - public String getChooseFromSession (final Product product, final HttpSession session) { - return this.app.getChooseFromSession(product, session); - } - /** * Some "getter" for HTML code 'disabled="disabled"' for e.g. submit buttons * @@ -157,18 +131,6 @@ public class PizzaServiceBean extends BaseFrameworkBean implements PizzaBean { return this.app.getPrintableProduktAvailability(product); } - /** - * Some getter for printable value from session or an empty string for null. - * - * @param session Session instance - * @param key Key to get - * @return Value from key, empty string for null - */ - @Override - public Object getPrintableValeFromSession (final HttpSession session, final String key) { - return this.app.getPrintableValeFromSession(session, key); - } - /** * Some "getter" for a an array of only available products * @@ -199,21 +161,6 @@ public class PizzaServiceBean extends BaseFrameworkBean implements PizzaBean { return this.app.getAllCategories(); } - /** - * Some "getter" for total price of position from request or session. - * Single price and amount is multiplyed. - * - * @param product Product instance - * @param request Request instance - * @param session Session instance - * @return Amount as string - */ - @Override - @Deprecated - public float getTotalPositionPriceFromRequestSession (final Product product, final HttpServletRequest request, final HttpSession session) { - return this.app.getTotalPositionPriceFromRequestSession(product, request, session); - } - /** * Checks whether the given product is choosen, request overules session. * -- 2.39.5