From 69c239cda2a09fe514334687568c6ae3b1c65b9c 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 --- .../JobsAdminCountryWebRequestBean.java | 19 +++++++++---------- .../JobsFeatureWebApplicationBean.java | 8 -------- .../login/JobsUserLoginWebSessionBean.java | 8 ++++---- 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java index 2b2c177d..8b015a12 100644 --- a/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java @@ -106,21 +106,20 @@ public class JobsAdminCountryWebRequestBean extends BaseJobsBean implements Jobs /** * 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/jjobs/beans/features/JobsFeatureWebApplicationBean.java b/src/java/org/mxchange/jjobs/beans/features/JobsFeatureWebApplicationBean.java index d8ac585b..f4d0abcc 100644 --- a/src/java/org/mxchange/jjobs/beans/features/JobsFeatureWebApplicationBean.java +++ b/src/java/org/mxchange/jjobs/beans/features/JobsFeatureWebApplicationBean.java @@ -16,7 +16,6 @@ */ package org.mxchange.jjobs.beans.features; -import javax.annotation.PostConstruct; import javax.enterprise.context.ApplicationScoped; import javax.inject.Named; import org.mxchange.jjobs.beans.BaseJobsBean; @@ -43,13 +42,6 @@ public class JobsFeatureWebApplicationBean extends BaseJobsBean implements JobsF 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/jjobs/beans/user/login/JobsUserLoginWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/user/login/JobsUserLoginWebSessionBean.java index 68c06de1..88b127e9 100644 --- a/src/java/org/mxchange/jjobs/beans/user/login/JobsUserLoginWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/login/JobsUserLoginWebSessionBean.java @@ -240,7 +240,7 @@ public class JobsUserLoginWebSessionBean extends BaseJobsBean implements JobsUse final User user = event.getCreatedUser(); // Set all fields here - this.copyUser(user); + this.copyToUser(user); } /** @@ -268,7 +268,7 @@ public class JobsUserLoginWebSessionBean extends BaseJobsBean implements JobsUse final User user = event.getLoggedInUser(); // Copy all data to this bean - this.copyUser(user); + this.copyToUser(user); } /** @@ -319,7 +319,7 @@ public class JobsUserLoginWebSessionBean extends BaseJobsBean implements JobsUse 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 JobsUserLoginWebSessionBean extends BaseJobsBean implements JobsUse *

* @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