* @param event Updated product data event
*/
public void afterProductUpdatedEvent (@Observes final ObservableProductUpdatedEvent event) {
- // event should not be null
+ // Event and contained entity instance should not be null
if (null == event) {
// Throw NPE
throw new NullPointerException("event is null"); //NOI18N
public void init () {
// Is cache there?
if (!this.productCache.iterator().hasNext()) {
- // Get whole list from EJB
- final List<Product> products = this.productBean.allProducts();
-
// "Walk" through all entries and add to cache
- for (final Product product : products) {
+ for (final Product product : this.productBean.allProducts()) {
// Add it by primary key
this.productCache.put(product.getProductId(), product);
}
public void init () {
// Is cache there?
if (!this.categoryCache.iterator().hasNext()) {
- // Get whole list from EJB
- final List<Category> categories = this.categoryBean.allCategories();
-
// "Walk" through all entries and add to cache
- for (final Category category : categories) {
+ for (final Category category : this.categoryBean.allCategories()) {
// Add it by primary key
this.categoryCache.put(category.getCategoryId(), category);
}