*/
public static final PizzaApplication getInstance (final ServletContext context) throws ServletException {
// Check application instance
- if (context == null) {
+ if (null == context) {
// Not set
throw new NullPointerException("application is null"); //NOI18N
}
this.getLogger().trace(MessageFormat.format("request={0},session={1} - CALLED!", request, session)); //NOI18N
// Is product and session set?
- if (request == null) {
+ if (null == request) {
// Not set
throw new NullPointerException("request is null"); //NOI18N
} else if (null == session) {
this.getLogger().trace(MessageFormat.format("request={0},session={1} - CALLED!", request, session)); //NOI18N
// Is product and session set?
- if (request == null) {
+ if (null == request) {
// Not set
throw new NullPointerException("request is null"); //NOI18N
} else if (null == session) {
Object object = this.getValueFromSession(product, session, HTTP_PARAM_AMOUNT);
// Is the object null?
- if (object == null) {
+ if (null == object) {
// Trace message
this.getLogger().trace("Returning 0 - EXIT!"); //NOI18N
if (null == product) {
// Not set
throw new NullPointerException("product is null"); //NOI18N
- } else if (request == null) {
+ } else if (null == request) {
// Not set
throw new NullPointerException("request is null"); //NOI18N
} else if (null == session) {
Object object = this.getValueFromSession(product, session, HTTP_PARAM_ITEM_ID);
// Is the object null?
- if (object == null) {
+ if (null == object) {
// Not found
this.getLogger().debug(MessageFormat.format("Returning empty string for product={0} ...", product.getItemId())); //NOI18N
return ""; //NOI18N
this.getLogger().trace(MessageFormat.format("request={0},session={1} - CALLED!", request, session)); //NOI18N
// Is product and session set?
- if (request == null) {
+ if (null == request) {
// Not set
throw new NullPointerException("request is null"); //NOI18N
} else if (null == session) {
if (null == product) {
// Not set
throw new NullPointerException("product is null"); //NOI18N
- } else if (request == null) {
+ } else if (null == request) {
// Not set
throw new NullPointerException("request is null"); //NOI18N
} else if (null == session) {
if (null == session) {
// Abort here
throw new NullPointerException("session is null"); //NOI18N
- } else if (key == null) {
+ } else if (null == key) {
// Abort here
throw new NullPointerException("key is null"); //NOI18N
}
if (null == product) {
// Not set
throw new NullPointerException("product is null"); //NOI18N
- } else if (request == null) {
+ } else if (null == request) {
// Not set
throw new NullPointerException("request is null"); //NOI18N
} else if (null == session) {
if (null == product) {
// Not set
throw new NullPointerException("product is null"); //NOI18N
- } else if (request == null) {
+ } else if (null == request) {
// Not set
throw new NullPointerException("request is null"); //NOI18N
} else if (null == session) {
if (null == product) {
// Not set
throw new NullPointerException("product is null"); //NOI18N
- } else if (request == null) {
+ } else if (null == request) {
// Not set
throw new NullPointerException("request is null"); //NOI18N
} else if (null == session) {
if (null == product) {
// Not set
throw new NullPointerException("product is null"); //NOI18N
- } else if (request == null) {
+ } else if (null == request) {
// Not set
throw new NullPointerException("request is null"); //NOI18N
} else if (null == session) {
this.getLogger().debug(MessageFormat.format("product={0},object={1}", product.getItemId(), object)); //NOI18N
// Is it null?
- if (object == null) {
+ if (null == object) {
// Unset session
this.getLogger().debug(MessageFormat.format("Unsetting session for product={0} ...", product.getItemId())); //NOI18N
this.clearSessionAttribute(product, session, HTTP_PARAM_ITEM_ID);
this.getLogger().trace(MessageFormat.format("request={0} - CALLED!", request)); //NOI18N
// request must not be null
- if (request == null) {
+ if (null == request) {
// Is null
throw new NullPointerException("request is null"); //NOI18N
}
Integer id = 0;
// Check all fields
- if (title == null) {
+ if (null == title) {
// "title" not set
throw new IllegalArgumentException(MessageFormat.format("{0} is not set.", PizzaCategoryDatabaseConstants.COLUMN_TITLE)); //NOI18N
} else if (title.isEmpty()) {
this.getLogger().trace(MessageFormat.format("request={0} - CALLED!", request)); //NOI18N
// request must not be null
- if (request == null) {
+ if (null == request) {
// Is null
throw new NullPointerException("request is null"); //NOI18N
}
Float p = null;
// Check all fields
- if (title == null) {
+ if (null == title) {
// "title" not set
throw new IllegalArgumentException(MessageFormat.format("{0} is not set.", PizzaProductDatabaseConstants.COLUMN_TITLE)); //NOI18N
} else if (title.isEmpty()) {
// Is left empty
throw new IllegalArgumentException(MessageFormat.format("{0} is empty.", PizzaProductDatabaseConstants.COLUMN_TITLE)); //NOI18N
- } else if (price == null) {
+ } else if (null == price) {
// "price" not set
throw new IllegalArgumentException(MessageFormat.format("{0} is not set.", PizzaProductDatabaseConstants.COLUMN_PRICE)); //NOI18N
} else if (price.isEmpty()) {
// Is left empty
throw new IllegalArgumentException(MessageFormat.format("{0} is empty.", PizzaProductDatabaseConstants.COLUMN_PRICE)); //NOI18N
- } else if (category == null) {
+ } else if (null == category) {
// "title" not set
throw new IllegalArgumentException(MessageFormat.format("{0} is not set.", PizzaProductDatabaseConstants.COLUMN_CATEGORY)); //NOI18N
} else if (category.isEmpty()) {
// Is left empty
throw new IllegalArgumentException(MessageFormat.format("{0} is empty.", PizzaProductDatabaseConstants.COLUMN_CATEGORY)); //NOI18N
- } else if (available == null) {
+ } else if (null == available) {
// "title" not set
throw new IllegalArgumentException(MessageFormat.format("{0} is not set.", PizzaProductDatabaseConstants.COLUMN_AVAILABLE)); //NOI18N
} else if (available.isEmpty()) {
this.getLogger().trace(MessageFormat.format("category={0} - CALLED!", category)); //NOI18N
// category must not be null
- if (category == null) {
+ if (null == category) {
// Is null
throw new NullPointerException("category is null"); //NOI18N
}
String title = request.getParameter(PizzaProductDatabaseConstants.COLUMN_TITLE);
// request must not be null and "title" must be found and non-empty
- if (request == null) {
+ if (null == request) {
// Abort here
throw new NullPointerException("request is null"); //NOI18N
- } else if (title == null) {
+ } else if (null == title) {
// title is not set
throw new IllegalArgumentException(MessageFormat.format("{0} is not set.", PizzaProductDatabaseConstants.COLUMN_TITLE)); //NOI18N
} else if (title.isEmpty()) {
this.getLogger().trace(MessageFormat.format("request={0},response={1} - CALLED!", request, response)); //NOI18N
// request and response must both be set
- if (request == null) {
+ if (null == request) {
// request is null
throw new NullPointerException("request is null"); //NOI18N
- } else if (response == null) {
+ } else if (null == response) {
// response is null
throw new NullPointerException("response is null"); //NOI18N
}
this.getLogger().trace(MessageFormat.format("request={0},response={1} - CALLED!", request, response)); //NOI18N
// request and response must both be set
- if (request == null) {
+ if (null == request) {
// request is null
throw new NullPointerException("request is null"); //NOI18N
- } else if (response == null) {
+ } else if (null == response) {
// response is null
throw new NullPointerException("response is null"); //NOI18N
}
String title = request.getParameter(PizzaCategoryDatabaseConstants.COLUMN_TITLE);
// request must not be null and "title" must be found and non-empty
- if (request == null) {
+ if (null == request) {
// Abort here
throw new NullPointerException("request is null"); //NOI18N
- } else if (title == null) {
+ } else if (null == title) {
// title is not set
throw new IllegalArgumentException(MessageFormat.format("{0} is not set.", PizzaCategoryDatabaseConstants.COLUMN_TITLE)); //NOI18N
} else if (title.isEmpty()) {
this.getLogger().trace(MessageFormat.format("title={0},price={1},category={2} - CALLED!", title, price, category)); //NOI18N
// Title should not be null
- if (title == null) {
+ if (null == title) {
// Abort here
throw new NullPointerException("title is null"); //NOI18N
- } else if (price == null) {
+ } else if (null == price) {
// Abort here
throw new NullPointerException("price is null"); //NOI18N
- } else if (category == null) {
+ } else if (null == category) {
// Abort here
throw new NullPointerException("category is null"); //NOI18N
- } else if (available == null) {
+ } else if (null == available) {
// Abort here
throw new NullPointerException("available is null"); //NOI18N
}
this.getLogger().trace("CALLED!"); //NOI18N
// Instance search criteria
- SearchableCriteria critera = new SearchCriteria();
+ SearchableCriteria criteria = new SearchCriteria();
// Run the query
- Result<? extends Storeable> result = this.getBackend().doSelectByCriteria(critera);
+ Result<? extends Storeable> result = this.getBackend().doSelectByCriteria(criteria);
// Debug message
this.getLogger().debug(MessageFormat.format("result={0}", result)); //NOI18N
this.getLogger().trace("CALLED!"); //NOI18N
// Instance search criteria
- SearchableCriteria critera = new SearchCriteria();
+ SearchableCriteria criteria = new SearchCriteria();
// Add criteria
- critera.addCriteria(PizzaProductDatabaseConstants.COLUMN_AVAILABLE, true);
+ criteria.addCriteria(PizzaProductDatabaseConstants.COLUMN_AVAILABLE, true);
// Run the query
- Result<? extends Storeable> result = this.getBackend().doSelectByCriteria(critera);
+ Result<? extends Storeable> result = this.getBackend().doSelectByCriteria(criteria);
// Debug message
this.getLogger().debug(MessageFormat.format("result={0}", result)); //NOI18N
this.getLogger().trace(MessageFormat.format("map={0} - CALLED!", map)); //NOI18N
// Is map null?
- if (map == null) {
+ if (null == map) {
// Is null
throw new NullPointerException("map is null"); //NOI18N
} else if (map.isEmpty()) {