From ed11c5c08c79fd4c9a38eedbd0914e43957330ab Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Tue, 11 Aug 2015 11:26:06 +0200 Subject: [PATCH] =?utf8?q?toArray(T[])=20must=20be=20used=20Signed-off-by:?= =?utf8?q?Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../application/PizzaServiceApplication.java | 16 ++++++++-------- web/index.jsp | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java index 647ab179..445228b4 100644 --- a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java +++ b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java @@ -352,7 +352,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P // Output it while (it.hasNext()) { Map.Entry entry = it.next(); - this.getLogger().debug(MessageFormat.format("entry {0}={1}", entry.getKey(), entry.getValue())); + this.getLogger().debug(MessageFormat.format("entry {0}={1}", entry.getKey(), entry.getValue())); //NOI18N } } @@ -977,25 +977,25 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P @Override public Object getPrintableValeFromSession (final HttpSession session, final String key) { // Trace message - this.getLogger().trace(MessageFormat.format("session={0},key={1} - CALLED", session, key)); + this.getLogger().trace(MessageFormat.format("session={0},key={1} - CALLED", session, key)); //NOI18N // Are both parameter not null? if (session == null) { // Abort here - throw new NullPointerException("session is null"); + throw new NullPointerException("session is null"); //NOI18N } else if (key == null) { // Abort here - throw new NullPointerException("key is null"); + 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)); + this.getLogger().debug(MessageFormat.format("value={0}", value)); //NOI18N // Trace message - this.getLogger().trace(MessageFormat.format("Calling this.convertNullToEmpty({0}) ... - EXIT!", value)); + this.getLogger().trace(MessageFormat.format("Calling this.convertNullToEmpty({0}) ... - EXIT!", value)); //NOI18N // Return actual value return this.convertNullToEmpty(value); @@ -1028,7 +1028,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P */ @Override public Product[] getProducts () { - return (Product[]) this.products.values().toArray(); + return this.products.values().toArray(new Product[this.products.size()]); } /** @@ -1053,7 +1053,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P // Mark it as ordered by setting flag this.getLogger().debug(MessageFormat.format("Marking product={0} as choosen.", product.getName())); //NOI18N - this.setValueInSession(product, session, HTTP_PARAM_CHOOSE, "1"); + this.setValueInSession(product, session, HTTP_PARAM_CHOOSE, "1"); //NOI18N // Trace message this.getLogger().trace("EXIT!"); //NOI18N diff --git a/web/index.jsp b/web/index.jsp index b72daf9a..ab34c085 100644 --- a/web/index.jsp +++ b/web/index.jsp @@ -58,7 +58,7 @@ <% - // Much smaller loop + // "Walk" through all products and unmark them as ordered for (final Product product : app.getUnmarkedProducts(session)) { %> -- 2.39.5