From 26ca642f72ed641223ce13d84019c372d1f62fd6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 20 Oct 2022 18:42:21 +0200 Subject: [PATCH] Please cherry-pick: - renamed copyUser() to copyToUser() because that method "copies" (read: sets) all required class fields except "entry-created" in given user instance - also used UserContact's parameterized constructor instead of default one and then setting all on my own - removed @PostConstruct method --- .../FinancialsAdminCountryWebRequestBean.java | 19 +++++++++---------- .../FinancialsFeatureWebApplicationBean.java | 8 -------- .../FinancialsUserLoginWebSessionBean.java | 8 ++++---- 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java index 4bbc8d32..3e689f7a 100644 --- a/src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java @@ -106,21 +106,20 @@ public class FinancialsAdminCountryWebRequestBean extends BaseFinancialsBean imp /** * Adds country to all relevant beans and sends it to the EJB. A redirect - * should happen after successfull creation. + * should happen after successful creation. *

* @todo Add field validation */ public void addCountry () { // Create new country object - final Country country = new CountryData(); - - // Add all data - country.setCountryAbroadDialPrefix(this.getCountryAbroadDialPrefix()); - country.setCountryCode(this.getCountryCode()); - country.setCountryExternalDialPrefix(this.getCountryExternalDialPrefix()); - country.setCountryI18nKey(this.getCountryI18nKey()); - country.setCountryIsLocalPrefixRequired(this.getCountryIsLocalPrefixRequired()); - country.setCountryPhoneCode(this.getCountryPhoneCode()); + final Country country = new CountryData( + this.getCountryAbroadDialPrefix(), + this.getCountryCode(), + this.getCountryExternalDialPrefix(), + this.getCountryI18nKey(), + this.getCountryIsLocalPrefixRequired(), + this.getCountryPhoneCode() + ); // Does it already exist? if (this.isCountryAdded(country)) { diff --git a/src/java/org/mxchange/jfinancials/beans/features/FinancialsFeatureWebApplicationBean.java b/src/java/org/mxchange/jfinancials/beans/features/FinancialsFeatureWebApplicationBean.java index 479b4975..840a314b 100644 --- a/src/java/org/mxchange/jfinancials/beans/features/FinancialsFeatureWebApplicationBean.java +++ b/src/java/org/mxchange/jfinancials/beans/features/FinancialsFeatureWebApplicationBean.java @@ -16,7 +16,6 @@ */ package org.mxchange.jfinancials.beans.features; -import javax.annotation.PostConstruct; import javax.enterprise.context.ApplicationScoped; import javax.inject.Named; import org.mxchange.jfinancials.beans.BaseFinancialsBean; @@ -43,13 +42,6 @@ public class FinancialsFeatureWebApplicationBean extends BaseFinancialsBean impl super(); } - /** - * Post-construction method - */ - @PostConstruct - public void initializeList () { - } - @Override public boolean isFeatureEnabled (final String feature) { // The parameter must be set diff --git a/src/java/org/mxchange/jfinancials/beans/user/login/FinancialsUserLoginWebSessionBean.java b/src/java/org/mxchange/jfinancials/beans/user/login/FinancialsUserLoginWebSessionBean.java index f92e9f72..7a0212bd 100644 --- a/src/java/org/mxchange/jfinancials/beans/user/login/FinancialsUserLoginWebSessionBean.java +++ b/src/java/org/mxchange/jfinancials/beans/user/login/FinancialsUserLoginWebSessionBean.java @@ -240,7 +240,7 @@ public class FinancialsUserLoginWebSessionBean extends BaseFinancialsBean implem final User user = event.getCreatedUser(); // Set all fields here - this.copyUser(user); + this.copyToUser(user); } /** @@ -268,7 +268,7 @@ public class FinancialsUserLoginWebSessionBean extends BaseFinancialsBean implem final User user = event.getLoggedInUser(); // Copy all data to this bean - this.copyUser(user); + this.copyToUser(user); } /** @@ -319,7 +319,7 @@ public class FinancialsUserLoginWebSessionBean extends BaseFinancialsBean implem final User registeredUser = event.getRegisteredUser(); // Copy all data from registered->user - this.copyUser(registeredUser); + this.copyToUser(registeredUser); // Set user id again this.setUserId(registeredUser.getUserId()); @@ -648,7 +648,7 @@ public class FinancialsUserLoginWebSessionBean extends BaseFinancialsBean implem *

* @param user User instance */ - private void copyUser (final User user) { + private void copyToUser (final User user) { // Copy all fields: // - base data this.setUserId(user.getUserId()); -- 2.39.5