]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
MessageFormat.format() used + ignored for internationalization
authorRoland Haeder <roland@mxchange.org>
Fri, 28 Aug 2015 11:18:25 +0000 (13:18 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 28 Aug 2015 11:18:25 +0000 (13:18 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/java/org/mxchange/pizzaapplication/tags/basket/MiniBasketTag.java

index a2b9440b12199134ae3bb8052b0712779f687991..2acf5258711dde3fc44f7508cd6628c254d93a77 100644 (file)
@@ -70,24 +70,24 @@ public class MiniBasketTag extends BodyTagSupport implements BasketTag {
        @Override
        public int doStartTag () throws JspException {
                // Trace message
-               this.LOG.trace("CALLED!");
+               this.LOG.trace("CALLED!"); //NOI18N
 
                // Init output
-               StringBuilder out = new StringBuilder("<div class=\"mini_basket\">\n");
+               StringBuilder out = new StringBuilder("<div class=\"mini_basket\">\n"); //NOI18N
 
                // basket should not be null
                if (this.getBasket() == null) {
                        // Not set
-                       throw new NullPointerException("basket instance is null");
+                       throw new NullPointerException("basket instance is null"); //NOI18N
                }
 
                try {
                        // Some entries found?
                        if (this.getBasket().isEmpty()) {
                                // Empty basket
-                               out.append("<div class=\"mini_basket_box\">\n");
-                               out.append(this.getBasket().getMessageStringFromKey("MiniBasketTag.basket_is_empty")).append("\n");
-                               out.append("</div>\n");
+                               out.append("<div class=\"mini_basket_box\">\n"); //NOI18N
+                               out.append(this.getBasket().getMessageStringFromKey("MiniBasketTag.basket_is_empty")).append("\n"); //NOI18N
+                               out.append("</div>\n"); //NOI18N
                        } else {
                                // Get all items
                                AddableBasketItem item = this.getBasket().getLast();
@@ -95,45 +95,45 @@ public class MiniBasketTag extends BodyTagSupport implements BasketTag {
                                // item cannot be null here
                                if (null == item) {
                                        // Abort here
-                                       throw new NullPointerException("item is null");
+                                       throw new NullPointerException("item is null"); //NOI18N
                                }
 
                                // Get application bean from session
-                               PizzaBean bean = (PizzaBean) this.getBasket().getSession().getAttribute("controller");
+                               PizzaBean bean = (PizzaBean) this.getBasket().getSession().getAttribute("controller"); //NOI18N
 
                                // Debug log
-                               this.LOG.debug("bean=" + bean);
+                               this.LOG.debug(MessageFormat.format("bean={0}", bean)); //NOI18N
 
                                // Should not be null
                                if (null == bean) {
                                        // Abort here
-                                       throw new NullPointerException("bean is null");
+                                       throw new NullPointerException("bean is null"); //NOI18N
                                }
 
                                // Get product instance
                                Product product = bean.getProduct(item);
 
                                // Debug message
-                               this.LOG.debug("product=" + product);
+                               this.LOG.debug(MessageFormat.format("product={0}", product)); //NOI18N
 
                                // Get last num rows
                                int lastNumRows = this.getBasket().getLastNumRows();
 
                                // Debug message
-                               this.LOG.debug("lastNumRows=" + lastNumRows);
+                               this.LOG.debug(MessageFormat.format("lastNumRows={0}", lastNumRows)); //NOI18N
 
                                // Output all
-                               out.append("<div class=\"mini_basket_box\">\n");
-                               out.append("  <div class=\"mini_basket_last\">\n");
-                               out.append("    ").append(MessageFormat.format(this.getBasket().getMessageStringFromKey("MiniBasketTag.last_item"), product.getTitle()));
-                               out.append("  </div>\n");
-                               out.append("  <div class=\"mini_basket_more\">\n");
-                               out.append("    ").append(MessageFormat.format(this.getBasket().getMessageStringFromKey("MiniBasketTag.additional_items"), (lastNumRows - 1)));
-                               out.append("  </div>\n");
-                               out.append("  <div class=\"mini_basket_link\">\n");
-                               out.append("    <a href=\"").append(this.getBasket().getApplication().getContextPath()).append("/basket.jsp\">").append(this.getBasket().getMessageStringFromKey("MiniBasketTag.to_basket")).append("</a>\n");
-                               out.append("  </div>\n");
-                               out.append("</div>\n");
+                               out.append("<div class=\"mini_basket_box\">\n"); //NOI18N
+                               out.append("  <div class=\"mini_basket_last\">\n"); //NOI18N
+                               out.append("    ").append(MessageFormat.format(this.getBasket().getMessageStringFromKey("MiniBasketTag.last_item"), product.getTitle())); //NOI18N
+                               out.append("  </div>\n"); //NOI18N
+                               out.append("  <div class=\"mini_basket_more\">\n"); //NOI18N
+                               out.append("    ").append(MessageFormat.format(this.getBasket().getMessageStringFromKey("MiniBasketTag.additional_items"), (lastNumRows - 1))); //NOI18N
+                               out.append("  </div>\n"); //NOI18N
+                               out.append("  <div class=\"mini_basket_link\">\n"); //NOI18N
+                               out.append("    <a href=\"").append(this.getBasket().getApplication().getContextPath()).append("/basket.jsp\">").append(this.getBasket().getMessageStringFromKey("MiniBasketTag.to_basket")).append("</a>\n"); //NOI18N
+                               out.append("  </div>\n"); //NOI18N
+                               out.append("</div>\n"); //NOI18N
                        }
                } catch (final ServletException | IOException | SQLException | BadTokenException | CorruptedDatabaseFileException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
                        // Continue to throw
@@ -141,7 +141,7 @@ public class MiniBasketTag extends BodyTagSupport implements BasketTag {
                }
 
                // Finish output
-               out.append("</div>\n");
+               out.append("</div>\n"); //NOI18N
 
                try {
                        // Get output instance and write it
@@ -152,7 +152,7 @@ public class MiniBasketTag extends BodyTagSupport implements BasketTag {
                }
 
                // Trace message
-               this.LOG.trace("Returning " + SKIP_BODY + " ... - EXIT!");
+               this.LOG.trace(MessageFormat.format("Returning {0} ... - EXIT!", SKIP_BODY)); //NOI18N
 
                // Don't process any body
                return SKIP_BODY;