From: Roland Häder Date: Fri, 10 Apr 2020 19:46:10 +0000 (+0200) Subject: Don't cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5e2a391620421e299df06b99313a95f366805f6d;p=jfinancials-war.git Don't cherry-pick: - WIP: rewrote admin-list-users view into ViewScoped - rewrote cache initialization to avoid a local List copy Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/list/FinancialsReceiptListWebViewBean.java b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/list/FinancialsReceiptListWebViewBean.java index 1afa4fbe..ed562fb9 100644 --- a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/list/FinancialsReceiptListWebViewBean.java +++ b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/list/FinancialsReceiptListWebViewBean.java @@ -235,11 +235,8 @@ public class FinancialsReceiptListWebViewBean extends BaseFinancialsBean impleme public void initCache () { // Is cache there? if (!this.receiptCache.iterator().hasNext()) { - // Get whole list from EJB - final List receipts = this.receiptBean.allReceipts(); - // Add all - for (final BillableReceipt receipt : receipts) { + for (final BillableReceipt receipt : this.receiptBean.allReceipts()) { // Add it to cache this.receiptCache.put(receipt.getReceiptId(), receipt); } diff --git a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/user/FinancialsReceiptUserWebSessionBean.java b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/user/FinancialsReceiptUserWebSessionBean.java index 8062eaf2..5e3ee7f4 100644 --- a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/user/FinancialsReceiptUserWebSessionBean.java +++ b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt/user/FinancialsReceiptUserWebSessionBean.java @@ -107,7 +107,7 @@ public class FinancialsReceiptUserWebSessionBean extends BaseFinancialsBean impl * @param event Event instance */ public void afterUserLoginEvent (@Observes final ObservableUserLoggedInEvent 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 diff --git a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/list/FinancialsReceiptItemListWebViewBean.java b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/list/FinancialsReceiptItemListWebViewBean.java index a9b5194a..20c7f566 100644 --- a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/list/FinancialsReceiptItemListWebViewBean.java +++ b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/list/FinancialsReceiptItemListWebViewBean.java @@ -132,7 +132,7 @@ public class FinancialsReceiptItemListWebViewBean extends BaseFinancialsBean imp * @param event Event instance */ public void afterUserLoginEvent (@Observes final ObservableUserLoggedInEvent 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 @@ -205,11 +205,8 @@ public class FinancialsReceiptItemListWebViewBean extends BaseFinancialsBean imp public void initCache () { // Is cache there? if (!this.receiptItemCache.iterator().hasNext()) { - // Get whole list from EJB - final List receiptItems = this.receiptItemBean.allReceiptItems(); - // Add all - for (final BillableReceiptItem receiptItem : receiptItems) { + for (final BillableReceiptItem receiptItem : this.receiptItemBean.allReceiptItems()) { // Add it to cache this.receiptItemCache.put(receiptItem.getItemId(), receiptItem); } diff --git a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/user/FinancialsReceiptItemUserWebSessionBean.java b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/user/FinancialsReceiptItemUserWebSessionBean.java index 6ab06eda..26af5364 100644 --- a/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/user/FinancialsReceiptItemUserWebSessionBean.java +++ b/src/java/org/mxchange/jfinancials/beans/financial/model/receipt_item/user/FinancialsReceiptItemUserWebSessionBean.java @@ -99,7 +99,7 @@ public class FinancialsReceiptItemUserWebSessionBean extends BaseFinancialsBean * @param event Event instance */ public void afterUserLoginEvent (@Observes final ObservableUserLoggedInEvent 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 diff --git a/web/WEB-INF/templates/admin/financial/receipt/admin_form_financial_receipt.tpl b/web/WEB-INF/templates/admin/financial/receipt/admin_form_financial_receipt.tpl index c2adafd7..26dd238f 100644 --- a/web/WEB-INF/templates/admin/financial/receipt/admin_form_financial_receipt.tpl +++ b/web/WEB-INF/templates/admin/financial/receipt/admin_form_financial_receipt.tpl @@ -109,7 +109,7 @@