From: Roland Haeder Date: Mon, 18 Apr 2016 18:59:42 +0000 (+0200) Subject: Fixed getter calls, the new ones are more descriptive. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a2a4c02897c0850c32ad39761dec7465eba82be2;p=pizzaservice-war.git Fixed getter calls, the new ones are more descriptive. Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionBean.java index 0cf61f87..b568ae42 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionBean.java @@ -261,19 +261,19 @@ public class PizzaUserWebSessionBean implements PizzaUserWebSessionController { if (null == event) { // Throw NPE throw new NullPointerException("event is null"); //NOI18N - } else if (event.getUser() == null) { + } else if (event.getRegisteredUser()== null) { // Throw NPE again throw new NullPointerException("event.user is null"); //NOI18N - } else if (event.getUser().getUserId() == null) { + } else if (event.getRegisteredUser().getUserId() == null) { // userId is null throw new NullPointerException("event.user.userId is null"); //NOI18N - } else if (event.getUser().getUserId() < 1) { + } else if (event.getRegisteredUser().getUserId() < 1) { // Not avalid id - throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getUser(), event.getUser().getUserId())); //NOI18N + throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getRegisteredUser(), event.getRegisteredUser().getUserId())); //NOI18N } // Get user instance - User registeredUser = event.getUser(); + User registeredUser = event.getRegisteredUser(); // Debug message System.out.println(MessageFormat.format("UserWebBean:afterRegistration: registeredUser={0}", registeredUser)); //NOI18N @@ -309,22 +309,22 @@ public class PizzaUserWebSessionBean implements PizzaUserWebSessionController { if (null == event) { // Throw NPE throw new NullPointerException("event is null"); //NOI18N - } else if (event.getUser() == null) { + } else if (event.getLoggedInUser() == null) { // Throw NPE again throw new NullPointerException("event.user is null"); //NOI18N - } else if (event.getUser().getUserId() == null) { + } else if (event.getLoggedInUser().getUserId() == null) { // userId is null throw new NullPointerException("event.user.userId is null"); //NOI18N - } else if (event.getUser().getUserId() < 1) { + } else if (event.getLoggedInUser().getUserId() < 1) { // Not avalid id - throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getUser(), event.getUser().getUserId())); //NOI18N + throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getLoggedInUser(), event.getLoggedInUser().getUserId())); //NOI18N } // Re-initialize list this.visibleUserList = this.userBean.allMemberPublicVisibleUsers(); // Copy all data to this bean - this.copyUser(event.getUser()); + this.copyUser(event.getLoggedInUser()); // Trace message System.out.println(MessageFormat.format("UserWebBean:afterUserLogin: this.visibleUserList.size()={0} - EXIT!", this.visibleUserList.size())); //NOI18N @@ -345,9 +345,11 @@ public class PizzaUserWebSessionBean implements PizzaUserWebSessionController { assert (this.isRequiredPersonalDataSet()) : "not all personal data is set"; //NOI18N // Create new user instance - User user = new LoginUser(); - user.setUserName(this.getUserName()); - user.setUserProfileMode(this.getUserProfileMode()); + User localUser = new LoginUser(); + + // Update all data ... + localUser.setUserName(this.getUserName()); + localUser.setUserProfileMode(this.getUserProfileMode()); // Generate phone number DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber()); @@ -427,12 +429,13 @@ public class PizzaUserWebSessionBean implements PizzaUserWebSessionController { contact.setContactOwnContact(Boolean.TRUE); // Set contact in user - user.setUserContact(contact); + localUser.setUserContact(contact); // Trace message //this.getLogger().logTrace(MessageFormat.format("createUserInstance: user={0} - EXIT!", user)); + // Return it - return user; + return localUser; } @Override