]> git.mxchange.org Git - jfinancials-war.git/blobdiff - src/java/org/mxchange/jfinancials/beans/business/branchoffice/list/FinancialsBranchOfficeListWebViewBean.java
Updated copyright year
[jfinancials-war.git] / src / java / org / mxchange / jfinancials / beans / business / branchoffice / list / FinancialsBranchOfficeListWebViewBean.java
index f525430897cb315c87ec38c82b404d7bf87062f0..e88cdbb876f83a863ad3d1fd3f4429cbcbf83dff 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 - 2020 Free Software Foundation
+ * Copyright (C) 2017 - 2022 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -112,8 +112,7 @@ public class FinancialsBranchOfficeListWebViewBean extends BaseFinancialsBean im
                        throw new IllegalArgumentException(MessageFormat.format("event.addedBranchOffice .branchId={0} is not valid", event.getAddedBranchOffice().getBranchId())); //NOI18N
                }
 
-               // Add instance to cache
-               this.branchOfficeCache.put(event.getAddedBranchOffice().getBranchId(), event.getAddedBranchOffice());
+               // Uniquely add branch office
                this.uniqueAddBranchOffice(event.getAddedBranchOffice());
        }
 
@@ -139,8 +138,7 @@ public class FinancialsBranchOfficeListWebViewBean extends BaseFinancialsBean im
                        throw new IllegalArgumentException(MessageFormat.format("event.updatedBranchOffice .branchId={0} is not valid", event.getUpdatedBranchOffice().getBranchId())); //NOI18N
                }
 
-               // Add instance to cache
-               this.branchOfficeCache.put(event.getUpdatedBranchOffice().getBranchId(), event.getUpdatedBranchOffice());
+               // Uniquely update branch office
                this.uniqueAddBranchOffice(event.getUpdatedBranchOffice());
        }
 
@@ -275,6 +273,9 @@ public class FinancialsBranchOfficeListWebViewBean extends BaseFinancialsBean im
         * @param branchOffice Branch office being added
         */
        private void uniqueAddBranchOffice (final BranchOffice branchOffice) {
+               // Add instance to cache
+               this.branchOfficeCache.put(branchOffice.getBranchId(), branchOffice);
+
                // Get iterator
                final Iterator<BranchOffice> iterator = this.getAllBranchOffices().iterator();