From 4b244668cc1caaaffec4d1f356b6a961973f4d3d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 29 Oct 2017 23:56:40 +0100 Subject: [PATCH] Maybe cherry-pick: - i18n key is localizable, not the direct category title MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../product/BaseFinancialsProductDatabaseBean.java | 4 ++-- .../FinancialsAdminProductCategorySessionBean.java | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/java/org/mxchange/jfinancials/database/product/BaseFinancialsProductDatabaseBean.java b/src/java/org/mxchange/jfinancials/database/product/BaseFinancialsProductDatabaseBean.java index df1f961..6331338 100644 --- a/src/java/org/mxchange/jfinancials/database/product/BaseFinancialsProductDatabaseBean.java +++ b/src/java/org/mxchange/jfinancials/database/product/BaseFinancialsProductDatabaseBean.java @@ -51,10 +51,10 @@ public abstract class BaseFinancialsProductDatabaseBean extends BaseFinancialsDa if (null == category) { // Throw NPE throw new NullPointerException("category is null"); - } else if(category.getCategoryTitle() == null) { + } else if(category.getCategoryI18nKey() == null) { // Throw it again throw new NullPointerException("category.categoryTitle is null"); - } else if (category.getCategoryTitle().isEmpty()) { + } else if (category.getCategoryI18nKey().isEmpty()) { // Throw it again throw new IllegalArgumentException("category.categoryTitle is empty"); } else if(category.getCategoryId() == null) { diff --git a/src/java/org/mxchange/jproduct/model/category/FinancialsAdminProductCategorySessionBean.java b/src/java/org/mxchange/jproduct/model/category/FinancialsAdminProductCategorySessionBean.java index 8d5cbc0..2766a5b 100644 --- a/src/java/org/mxchange/jproduct/model/category/FinancialsAdminProductCategorySessionBean.java +++ b/src/java/org/mxchange/jproduct/model/category/FinancialsAdminProductCategorySessionBean.java @@ -61,10 +61,10 @@ public class FinancialsAdminProductCategorySessionBean extends BaseFinancialsPro if (null == category) { // Throw NPE throw new NullPointerException("category is null"); //NOI18N - } else if (category.getCategoryTitle() == null) { + } else if (category.getCategoryI18nKey() == null) { // Throw it again throw new NullPointerException("category.categoryTitle is null"); //NOI18N - } else if (category.getCategoryTitle().isEmpty()) { + } else if (category.getCategoryI18nKey().isEmpty()) { // Throw it again throw new IllegalArgumentException("category.categoryTitle is empty"); //NOI18N } else if (category.getCategoryId() != null) { @@ -109,10 +109,10 @@ public class FinancialsAdminProductCategorySessionBean extends BaseFinancialsPro if (null == category) { // Throw NPE throw new NullPointerException("category is null"); //NOI18N - } else if (category.getCategoryTitle() == null) { + } else if (category.getCategoryI18nKey() == null) { // Throw it again throw new NullPointerException("category.categoryTitle is null"); //NOI18N - } else if (category.getCategoryTitle().isEmpty()) { + } else if (category.getCategoryI18nKey().isEmpty()) { // Throw it again throw new IllegalArgumentException("category.categoryTitle is empty"); //NOI18N } else if (category.getCategoryId() != null) { @@ -129,7 +129,7 @@ public class FinancialsAdminProductCategorySessionBean extends BaseFinancialsPro // Check each entry for (final Category createdCategory : list) { // Is same name? - if (Objects.equals(createdCategory.getCategoryTitle(), category.getCategoryTitle())) { + if (Objects.equals(createdCategory.getCategoryI18nKey(), category.getCategoryI18nKey())) { // Found it, then stop here isFound = true; break; -- 2.39.5