From f34d19daf0fb0888c0eb000af0292372c3522b98 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 4 Sep 2015 23:41:39 +0200 Subject: [PATCH] =?utf8?q?Now=20an=20empty=20library,=20but=20it=20will=20?= =?utf8?q?come=20back=20...=20;-)=20Signed-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/jshop-core.jar | Bin 0 -> 28048 bytes nbproject/project.properties | 5 +- .../application/PizzaApplication.java | 219 ---------- .../application/PizzaServiceApplication.java | 399 ------------------ 4 files changed, 4 insertions(+), 619 deletions(-) create mode 100644 lib/jshop-core.jar delete mode 100644 src/org/mxchange/pizzaapplication/application/PizzaApplication.java delete mode 100644 src/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java diff --git a/lib/jshop-core.jar b/lib/jshop-core.jar new file mode 100644 index 0000000000000000000000000000000000000000..4f792b81035d945a232fd0899b34a041b7538133 GIT binary patch literal 28048 zcmeHQYiu0Xbw0CPa(0(Pkz7)wL`gP9z4#Cx67_zXq)3|*Daj_Km{wwINsg$Mmb=vM z(h}{&iIc`jkRmP6rb!y00h$N;@Q)UCC@FF3v`Nt-2#TU85FiEG!avfqKpP-HivR)K ze&^nK@67Iyl#RHkgqhu)xpVKi=bm%!Io~~Zc=I7Ml4bb6?F z{Nh;uJ3k=0Y!!VIMSq&qzqWwld^F>*icSt)93LB>Jmd)$CaU_)Z9(I9oKO4c;BJA#7JIG74`Yv;T0}_v~S>rBZqru2M@M)UdpHD zGJ5++F29t^r;4btt1eNOa1-X}0(wA{%P;f?m#8yJEZ&>DnaVEcWs0_Xi{2{S%q`93 z^5q`t2!2SvH>WRgCkka6-4Xo!Vs2i~lzDV_rAKE|h1+_uObuNjYe*OM#WL0GtyIk% z#(N=`Unx^ZU+6lP^11otxpLjAOwV$mm|N8IW#}n0u5w%|@T4MZ#q$+MXip`!ROUu+ z*eVwEte#KLd6@F>=ZAOvFhayf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&birH5Il8EaD=#bfE}UT)PC+1PmDMF#JjgfS1HlGwHon;bg-C)4mQYGUSP;? zKU{X+pTf&rC$VrgBm#&dg0?fVePEVM8^4cKhFkoN-E^eb;T!wO@Q?6q2ZFJv_{N?h zzZSb4zpz#5@&zT*T!q;J?fU&O29(0T2Ko=S@b=$Zkbj!Ne$?-eGw=ia?`yC2;OzIO z8k~)D4WhVlVru0-Zv6ZB%8Fd>3Epum|M3$)!B>~+mwS}ctmHp_6e*+qF1@9*bld>`in|c8S5P7YUH=> z+cj1}-dxPKIVOoSY7{G1<*Ma1bGzE}m8vzt-Lia?Z$#o+nU9|fU8m(0mKh^Ay+5v4 zx0%{ojt3nE2PD0ZL4nJ%wjxj6L-l;9`a(zm2XOKqv-Rthstv>w_5L;_U&rNuxTKmTCUQ1v%Fj|@z(2obG%*e z-@-Tt)a$S%=B5p?D?Io;^4?~@=XtHQ-RvJAjk|KQh6}&OR=scEwOhU05ZJ2AmheE~ z!0NI;JH79LvRk->wXlGGd0Pmq-TR6cyY|0_{)VYt=q)ctlkE{EOC}^&@|H4 zUK$addiBP;kHv1`XGg=fAPkMsod3{xH%-{B{1kaFW&0rntR$bnzZq{zx!ufx(_xxn z8Dm-YuicxiW7mG@sW7$A`seO=N5s31Z8!7kWQAr-+2Vc}2F<@KUfj`c. - */ -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; -import org.mxchange.jcore.application.Application; -import org.mxchange.jshop.category.Category; -import org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException; -import org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException; -import org.mxchange.jshop.item.AddableBasketItem; -import org.mxchange.jshop.product.Product; - -/** - * - * @author Roland Haeder - */ -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 getAvailableProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; - - /** - * 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 getAllProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; - - /** - * 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 getAllCategories () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; - - /** - * Initializes this instance with given ServletContext - * - * @throws java.sql.SQLException If an SQL error occurs - * @throws java.io.IOException If an IO error occurs - */ - public void init () throws SQLException, IOException; - - /** - * 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 getAvailableProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; - - /** - * 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 getAllProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; - - /** - * 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 getAllCategoriesIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; - - /** - * Generates a link for category's parent category. If none is given, the method will return only a small - * note. - * - * @param category Category instance - * @return HTML link for category's parent category - * @deprecated Old lost code - */ - @Deprecated - public String generateLinkForParent (final Category category); - - /** - * Checks if given Product instance is available and returns a printable - * (human-readable) string. - * - * @param product Product instance to check - * @return Human-readable version of product availability - * @deprecated Old lost code - */ - @Deprecated - public String getPrintableProductAvailability (final Product product); - - /** - * Returns a printable (human-readable) string of product's category - * - * @param product Product instance to check - * @return Human-readable version of product availability - * @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? - * @deprecated Old lost code - */ - @Deprecated - public String getPrintableProductCategory (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; - - /** - * Adds given category data from request to database - * - * @param category Category to be added - * @throws org.mxchange.jshop.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? - */ - public void doAdminAddCategory (final Category category) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException; - - /** - * Adds given product data from request to database - * - * @param product Product instance to add - * @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.jshop.exceptions.ProductTitleAlreadyUsedException If the product's title is already used - */ - public void doAdminAddProduct (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException; - - /** - * Handles admin product form requests - * - * @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.jshop.exceptions.ProductTitleAlreadyUsedException If the product's title is already used - * @deprecated Old lost code - */ - @Deprecated - public void doAdminHandleProductForms () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException; - - /** - * Handles admin category form requests - * - * @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.jshop.exceptions.CategoryTitleAlreadyUsedException The category's title is already used - * @deprecated Old lost code - */ - @Deprecated - public void doAdminHandleCategoryForms () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException; - - /** - * Some "getter" for a Product instance from given item - * - * @param item Item instance - * @return A 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? - */ - public Product getProduct (final AddableBasketItem item) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; -} diff --git a/src/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java b/src/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java deleted file mode 100644 index 0bcf99b..0000000 --- a/src/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java +++ /dev/null @@ -1,399 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -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; -import java.util.Iterator; -import org.mxchange.jcore.BaseFrameworkSystem; -import org.mxchange.jshop.category.Category; -import org.mxchange.jshop.exceptions.CategoryTitleAlreadyUsedException; -import org.mxchange.jshop.exceptions.ProductTitleAlreadyUsedException; -import org.mxchange.jshop.item.AddableBasketItem; -import org.mxchange.jshop.product.Product; - -/** - * Main application class - * - * @author Roland Haeder - */ -public class PizzaServiceApplication extends BaseFrameworkSystem implements PizzaApplication { - /** - * Default constructor - */ - public PizzaServiceApplication () { - // Trace message - this.getLogger().trace("CALLED!"); //NOI18N - } - - @Override - public Deque getAllCategories () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { - // Deligate to frontend - return this.categoryFrontend.getAllCategories(); - } - - @Override - public Deque getAllProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { - // Deligate to frontend - return this.productFrontend.getAllProducts(); - } - - @Override - public Deque getAvailableProducts () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { - // Deligate to frontend - return this.productFrontend.getAllAvailableProducts(); - } - - @Override - public void init () throws SQLException { - // Trace message - this.getLogger().trace("CALLED!"); //NOI18N - - // Is the bundle initialized? - if (!BaseFrameworkSystem.isBundledInitialized()) { - // Temporary initialize default bundle - // TODO The enum Gender uses this - this.initBundle(); - } - - // Trace message - this.getLogger().trace("EXIT!"); //NOI18N - } - - @Override - public void doBootstrap () { - throw new UnsupportedOperationException("Not supported yet."); //NOI18N - } - - @Override - public void doMainLoop () { - throw new UnsupportedOperationException("Not supported yet."); //NOI18N - } - - @Override - public void doShutdown () { - throw new UnsupportedOperationException("Not supported yet."); //NOI18N - } - - @Override - @Deprecated - public String getPrintableProductAvailability (final Product product) { - // Trace message - this.getLogger().trace(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N - - // Is it null? - if (null == product) { - // Should not be null - throw new NullPointerException("product is null"); //NOI18N - } - - // Get availability - if (product.getAvailable() == true) { - // Is available - return "Ja"; - } else { - // Not, not for public - return "Nein"; - } - } - - @Override - @SuppressWarnings ("unchecked") - public Iterator getAvailableProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { - // Trace message - this.getLogger().trace("CALLED!"); //NOI18N - - // Ask frontend for a list of products - return this.productFrontend.getAvailableProductsIterator(); - } - - @Override - @SuppressWarnings ("unchecked") - public Iterator getAllProductsIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { - // Trace message - this.getLogger().trace("CALLED!"); //NOI18N - - // Ask frontend for a list of products - return this.productFrontend.getAllProductsIterator(); - } - - @Override - @SuppressWarnings ("unchecked") - public Iterator getAllCategoriesIterator () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { - // Trace message - this.getLogger().trace("CALLED!"); //NOI18N - - // Ask frontend for a list of categories - return this.categoryFrontend.getAllCategoriesIterator(); - } - - /** - * Checks whether given category title is already used - * - * @param category Category instance - * @return Whether it has been found - */ - private boolean isCategoryTitleUsed(final Category category) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - // Trace message - this.getLogger().trace("CALLED!"); //NOI18N - - // Delegate to frontend - return this.categoryFrontend.isCategoryTitleUsed(category.getTitle()); - } - - /** - * Checks if given product title is already used - * @param title Product title to check - * @return Whether the product title has already been used - */ - private boolean isProductTitleUsed (final String title) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - // Trace message - this.getLogger().trace("CALLED!"); //NOI18N - - // Delegate to frontend - return this.productFrontend.isProductTitleUsed(title); - } - - @Override - public void doAdminAddCategory (final Category category) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException { - // Trace message - this.getLogger().trace(MessageFormat.format("category={0} - CALLED!", category)); //NOI18N - - // request must not be null - if (null == category) { - // Is null - throw new NullPointerException("category is null"); //NOI18N - } - - // Get all fields - String title = category.getTitle(); - Long parentId = category.getParentId(); - - // Debug message - this.getLogger().debug(MessageFormat.format("title={0},parentId={1}", title, parentId)); //NOI18N - - // Check all fields - if (null == title) { - // "title" not set - throw new IllegalArgumentException("category title is not set."); //NOI18N - } else if (title.isEmpty()) { - // Is left empty - throw new IllegalArgumentException("category title is empty."); //NOI18N - } else if ((parentId == null) || (parentId == 0)) { - // "parent" is not set - throw new IllegalArgumentException(MessageFormat.format("category id is not valid: {0}", parentId)); - } - - // Try to check if title is used already - if (this.isCategoryTitleUsed(category)) { - // Title already used - throw new CategoryTitleAlreadyUsedException(category); - } - - // The category is not found, so add it to database - this.categoryFrontend.addCategory(title, parentId); - - // Trace message - this.getLogger().trace("EXIT!"); //NOI18N - } - - @Override - public void doAdminAddProduct (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException { - // Trace message - this.getLogger().trace(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N - - // product must not be null - if (null == product) { - // Is null - throw new NullPointerException("product is null"); //NOI18N - } - - // Get title, price and category id - String title = product.getTitle(); - Float price = product.getPrice(); - Long categoryId = product.getCategoryId(); - Boolean available = product.getAvailable(); - - // Debug message - this.getLogger().debug(MessageFormat.format("title={0},price={1},categoryId={2},available={3}", title, price, categoryId, available)); //NOI18N - - // Check all fields - if (null == title) { - // "title" not set - throw new IllegalArgumentException("product title is not set."); //NOI18N - } else if (title.isEmpty()) { - // Is left empty - throw new IllegalArgumentException("product title is empty."); //NOI18N - } else if (null == price) { - // "price" not set - throw new IllegalArgumentException("product price is not set."); //NOI18N - } else if (null == categoryId) { - // "categoryId" not set - throw new IllegalArgumentException("product category id is not set."); //NOI18N - } else if (null == available) { - // "available" not set - throw new IllegalArgumentException("product availability is not set."); //NOI18N - } - - // Try to check if title is used already - if (this.isProductTitleUsed(product)) { - // Title already used - throw new ProductTitleAlreadyUsedException(product); - } - - // The product is not found, so add it to database - this.productFrontend.addProduct(title, price, categoryId, available); - - // Trace message - this.getLogger().trace("EXIT!"); //NOI18N - } - - @Override - @Deprecated - public String generateLinkForParent (final Category category) { - // Trace message - this.getLogger().trace(MessageFormat.format("category={0} - CALLED!", category)); //NOI18N - - // category must not be null - if (null == category) { - // Is null - throw new NullPointerException("category is null"); //NOI18N - } - - // Get parent id - Long parentId = category.getParentId(); - - // Is the id set? - if (parentId > 0) { - // Product HTML code for link - throw new UnsupportedOperationException(MessageFormat.format("parentId={0} - Unfinished!", parentId)); //NOI18N - } - - // No parent set - return "Keine"; - } - - @Override - @Deprecated - public String getPrintableProductCategory (final Product product) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { - // Trace message - this.getLogger().trace(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N - - // product must not be null - if (null == product) { - // Abort here - throw new NullPointerException("product is null"); //NOI18N - } - - // Declare category - Category category = this.categoryFrontend.getCategory(product); - - // Debug message - this.getLogger().debug(MessageFormat.format("category={0}", category)); //NOI18N - - // Get decoded title - String title = category.getDecodedTitle(); - - // Trace message - this.getLogger().trace(MessageFormat.format("title={0} - EXIT!", title)); //NOI18N - - // Return it - return title; - } - - /** - * Checks if product's title is already used. - * - * @param request Request 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 { - // Trace message - this.getLogger().trace(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N - - // request must not be null and "title" must be found and non-empty - if (null == product) { - // Abort here - throw new NullPointerException("request is null"); //NOI18N - } - - // Init title - String title = product.getTitle(); - - if (null == title) { - // title is not set - throw new IllegalArgumentException("product title is not set."); //NOI18N - } else if (title.isEmpty()) { - // Is left empty - throw new IllegalArgumentException("product title is empty."); //NOI18N - } - - // Default is not used - boolean isUsed = this.isProductTitleUsed(title); - - // Trace message - this.getLogger().trace(MessageFormat.format("isUsed={0} - EXIT!", isUsed)); //NOI18N - - // Return it - return isUsed; - } - - @Override - @Deprecated - public void doAdminHandleProductForms () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ProductTitleAlreadyUsedException { - // Deprecated method called - throw new UnsupportedOperationException("Deprecated method has been called."); - } - - @Override - @Deprecated - public void doAdminHandleCategoryForms () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, CategoryTitleAlreadyUsedException { - // Deprecated method called - throw new UnsupportedOperationException("Deprecated method has been called."); - } - - @Override - public Product getProduct (final AddableBasketItem item) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { - // Trace message - this.getLogger().trace(MessageFormat.format("item={0} - CALLED!", item)); //NOI18N - - // item should not be null - if (null == item) { - // Abort here - throw new NullPointerException("item is null"); //NOI18N - } - - // Init product instance - Product product = this.productFrontend.getProduct(item); - - // Trace message - this.getLogger().trace(MessageFormat.format("product={0} - EXIT!", product)); //NOI18N //NOI18N - - // Return it - return product; - } -} -- 2.39.5