From 79566828716a3a21a024c86a9f2939d84f4b1f78 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 20 Apr 2017 11:29:15 +0200 Subject: [PATCH] Please cherry-pick: - let's get rid of all these debug messages MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../beans/BaseAddressbookController.java | 4 --- .../helper/AddressbookWebRequestHelper.java | 16 ++-------- .../AddressbookLocalizationSessionBean.java | 31 ------------------- .../AddressbookAdminUserWebRequestBean.java | 17 +++------- .../AddressbookEmailAddressValidator.java | 6 ---- .../names/AddressbookNameValidator.java | 7 +---- .../AddressbookUserPasswordValidator.java | 6 ---- ...ressbookPrivacyTermsCheckboxValidator.java | 6 ---- 8 files changed, 8 insertions(+), 85 deletions(-) diff --git a/src/java/org/mxchange/addressbook/beans/BaseAddressbookController.java b/src/java/org/mxchange/addressbook/beans/BaseAddressbookController.java index 547720e1..1b736392 100644 --- a/src/java/org/mxchange/addressbook/beans/BaseAddressbookController.java +++ b/src/java/org/mxchange/addressbook/beans/BaseAddressbookController.java @@ -17,7 +17,6 @@ package org.mxchange.addressbook.beans; import java.io.Serializable; -import java.text.MessageFormat; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; @@ -109,9 +108,6 @@ public abstract class BaseAddressbookController implements Serializable { * @param cause Causing exception */ protected void showFacesMessage (final String clientId, final Throwable cause) { - // Trace message - System.out.println(MessageFormat.format("showFacesMessage: clientId={0},cause={1} - CALLED!", clientId, cause)); - // Get context and add message this.showFacesMessage(clientId, cause.getMessage()); } diff --git a/src/java/org/mxchange/addressbook/beans/helper/AddressbookWebRequestHelper.java b/src/java/org/mxchange/addressbook/beans/helper/AddressbookWebRequestHelper.java index 9ed6d04b..71392464 100644 --- a/src/java/org/mxchange/addressbook/beans/helper/AddressbookWebRequestHelper.java +++ b/src/java/org/mxchange/addressbook/beans/helper/AddressbookWebRequestHelper.java @@ -21,13 +21,13 @@ import javax.enterprise.context.RequestScoped; import javax.inject.Inject; import javax.inject.Named; import org.mxchange.addressbook.beans.contact.AddressbookAdminContactWebRequestController; +import org.mxchange.addressbook.beans.phone.AddressbookAdminPhoneWebRequestController; import org.mxchange.addressbook.beans.user.AddressbookUserWebSessionController; import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; import org.mxchange.jusercore.model.user.User; -import org.mxchange.addressbook.beans.phone.AddressbookAdminPhoneWebRequestController; /** * A general helper for beans @@ -79,9 +79,6 @@ public class AddressbookWebRequestHelper implements AddressbookWebRequestControl @Override public void copyContactToController () { - // Log message - //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyContactToController - CALLED!"); //NOI18N - // Validate user instance if (this.getContact() == null) { // Throw NPE @@ -99,16 +96,10 @@ public class AddressbookWebRequestHelper implements AddressbookWebRequestControl // Set all fields: user this.adminContactController.copyContactToController(this.getContact()); - - // Log message - //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyContactToController - EXIT!"); //NOI18N } @Override public void copyUserToController () { - // Log message - //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyUserToController - CALLED!"); //NOI18N - // Validate user instance if (this.getUser() == null) { // Throw NPE @@ -132,9 +123,6 @@ public class AddressbookWebRequestHelper implements AddressbookWebRequestControl // Set all fields: user this.userController.setUserName(this.getUser().getUserName()); - - // Log message - //* NOISY-DEBUG: */ System.out.println("AdminHelper::copyUserToController - EXIT!"); //NOI18N } @Override diff --git a/src/java/org/mxchange/addressbook/beans/localization/AddressbookLocalizationSessionBean.java b/src/java/org/mxchange/addressbook/beans/localization/AddressbookLocalizationSessionBean.java index 6a448560..413bd043 100644 --- a/src/java/org/mxchange/addressbook/beans/localization/AddressbookLocalizationSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/localization/AddressbookLocalizationSessionBean.java @@ -51,9 +51,6 @@ public class AddressbookLocalizationSessionBean extends BaseAddressbookControlle @Override public void afterUserLogin (@Observes final ObservableUserLoggedInEvent event) { - // Trace message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("LandingLocalizationSessionBean:afterUserLogin: event={0} - CALLED!", event)); //NOI18N - // event should not be null if (null == event) { // Throw NPE @@ -71,16 +68,10 @@ public class AddressbookLocalizationSessionBean extends BaseAddressbookControlle // Set locale here this.setLocale(event.getLoggedInUser().getUserLocale()); - - // Trace message - //* NOISY-DEBUG: */ System.out.println("LandingLocalizationSessionBean:afterUserLogin - EXIT!"); //NOI18N } @Override public void afterUserLogout (@Observes final ObservableUserLogoutEvent event) { - // Trace message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("ReportsLocalizationSessionBean:afterUserLogin: event={0} - CALLED!", event)); //NOI18N - // event should not be null if (null == event) { // Throw NPE @@ -98,22 +89,15 @@ public class AddressbookLocalizationSessionBean extends BaseAddressbookControlle // Clear this bean as well this.clear(); - - // Trace message - //* NOISY-DEBUG: */ System.out.println("ReportsLocalizationSessionBean:afterUserLogin - EXIT!"); //NOI18N } @Override public String getLanguage () { - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AddressbookLocalizationSessionBean::getLanguage(): locale.language={0} - EXIT!", this.getLocale().getLanguage())); //NOI18N return this.getLocale().getLanguage().toLowerCase(); } @Override public void setLanguage (final String language) { - // Log trace message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AddressbookLocalizationSessionBean::setLanguage: language={0} - CALLED!", language)); //NOI18N - // Is the language null? if (null == language) { // This may sometimes happen, so abort here @@ -129,25 +113,18 @@ public class AddressbookLocalizationSessionBean extends BaseAddressbookControlle // Get new locale with upper-case country code Locale loc = new Locale(splits[0], splits[1]); - // Log debug message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AddressbookLocalizationSessionBean::setLanguage: loc={0}", loc)); //NOI18N // Set it here and in the JSF context this.setLocale(loc); FacesContext.getCurrentInstance().getViewRoot().setLocale(loc); - - // Log trace message - //* NOISY-DEBUG: */ System.out.println("AddressbookLocalizationSessionBean::setLanguage: EXIT!"); //NOI18N } @Override public Locale getLocale () { - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AddressbookLocalizationSessionBean::getLocale(): locale={0} - EXIT!", this.locale)); //NOI18N return this.locale; } @Override public void setLocale (final Locale locale) { - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AddressbookLocalizationSessionBean::setLocale(): locale={0} - CALLED!", locale)); //NOI18N this.locale = locale; } @@ -165,19 +142,11 @@ public class AddressbookLocalizationSessionBean extends BaseAddressbookControlle */ @PostConstruct public void init () { - // Log trace message - //* NOISY-DEBUG: */ System.out.println("AddressbookLocalizationSessionBean::init: CALLED!"); //NOI18N - // Create locale instance from context Locale loc = FacesContext.getCurrentInstance().getExternalContext().getRequestLocale(); - // Log debug message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AddressbookLocalizationSessionBean::init: loc={0}", loc)); //NOI18N // Set it here this.setLocale(loc); - - // Log trace message - //* NOISY-DEBUG: */ System.out.println("AddressbookLocalizationSessionBean::init: EXIT!"); //NOI18N } /** diff --git a/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java index 4dd5355f..5b097d9e 100644 --- a/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java @@ -36,9 +36,13 @@ import org.mxchange.addressbook.beans.helper.AddressbookWebRequestController; import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jcoreee.utils.FacesUtils; import org.mxchange.jusercore.container.login.UserLoginContainer; +import org.mxchange.jusercore.events.registration.ObservableUserRegisteredEvent; import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent; +import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent; import org.mxchange.jusercore.events.user.linked.AdminLinkedUserEvent; +import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent; import org.mxchange.jusercore.events.user.update.AdminUpdatedUserDataEvent; +import org.mxchange.jusercore.events.user.update.ObservableAdminUpdatedUserDataEvent; import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException; import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException; import org.mxchange.jusercore.exceptions.UserNotFoundException; @@ -53,10 +57,6 @@ import org.mxchange.jusercore.model.user.UserSessionBeanRemote; import org.mxchange.jusercore.model.user.UserUtils; import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; import org.mxchange.jusercore.model.user.status.UserAccountStatus; -import org.mxchange.jusercore.events.registration.ObservableUserRegisteredEvent; -import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent; -import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent; -import org.mxchange.jusercore.events.user.update.ObservableAdminUpdatedUserDataEvent; /** * A user bean (controller) @@ -299,9 +299,6 @@ public class AddressbookAdminUserWebRequestBean extends BaseAddressbookControlle @Override public void afterRegistrationEvent (@Observes final ObservableUserRegisteredEvent event) { - // Trace message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AdminUserWebBean:afterRegistration: event={0} - CALLED!", event)); //NOI18N - // event should not be null if (null == event) { // Throw NPE @@ -320,14 +317,10 @@ public class AddressbookAdminUserWebRequestBean extends BaseAddressbookControlle // Get user instance User registeredUser = event.getRegisteredUser(); - // Debug message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("UserWebBean:afterRegistration: registeredUser={0}", registeredUser)); //NOI18N + // @TODO Nothing to do with the user here? // Clear all data this.clear(); - - // Trace message - //* NOISY-DEBUG: */ System.out.println("AdminUserWebBean:afterRegistration: EXIT!"); //NOI18N } @Override diff --git a/src/java/org/mxchange/addressbook/validator/emailaddress/AddressbookEmailAddressValidator.java b/src/java/org/mxchange/addressbook/validator/emailaddress/AddressbookEmailAddressValidator.java index 6dddd16b..36a37a5f 100644 --- a/src/java/org/mxchange/addressbook/validator/emailaddress/AddressbookEmailAddressValidator.java +++ b/src/java/org/mxchange/addressbook/validator/emailaddress/AddressbookEmailAddressValidator.java @@ -68,9 +68,6 @@ public class AddressbookEmailAddressValidator extends BaseStringValidator implem @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { - // Trace message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("validate: context={0},component={1},value={2} - CALLED!", context, component, value)); //NOI18N - // The required field String[] requiredFields = {"emailAddress", "emailAddressRepeat", "resendEmailAddress"}; //NOI18N @@ -111,9 +108,6 @@ public class AddressbookEmailAddressValidator extends BaseStringValidator implem // No, then abort here throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message)); } - - // Trace message - //* NOISY-DEBUG: */ System.out.println("validate: EXIT!"); //NOI18N } } diff --git a/src/java/org/mxchange/addressbook/validator/names/AddressbookNameValidator.java b/src/java/org/mxchange/addressbook/validator/names/AddressbookNameValidator.java index 4007836e..79ca0c7f 100644 --- a/src/java/org/mxchange/addressbook/validator/names/AddressbookNameValidator.java +++ b/src/java/org/mxchange/addressbook/validator/names/AddressbookNameValidator.java @@ -38,16 +38,11 @@ public class AddressbookNameValidator extends BaseStringValidator implements Val @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { - // Trace message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("validate: context={0},component={1},value={2} - CALLED!", context, component, value)); //NOI18N - // All accepted, required fields String[] requiredFields = {"firstName", "familyName", "city", "street", "addressbookName"}; //NOI18N // Pre-validation (example: not null, not a string, empty string ...) super.preValidate(context, component, value, requiredFields, false); - - // Trace message - //* NOISY-DEBUG: */ System.out.println("validate: EXIT!"); //NOI18N } + } diff --git a/src/java/org/mxchange/addressbook/validator/password/AddressbookUserPasswordValidator.java b/src/java/org/mxchange/addressbook/validator/password/AddressbookUserPasswordValidator.java index b6cf6154..2f9c329f 100644 --- a/src/java/org/mxchange/addressbook/validator/password/AddressbookUserPasswordValidator.java +++ b/src/java/org/mxchange/addressbook/validator/password/AddressbookUserPasswordValidator.java @@ -39,9 +39,6 @@ public class AddressbookUserPasswordValidator extends BaseStringValidator implem @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { - // Trace message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("validate: context={0},component={1},value={2} - CALLED!", context, component, value)); //NOI18N - // The required field String[] requiredFields = {"currentPassword"}; //NOI18N @@ -59,9 +56,6 @@ public class AddressbookUserPasswordValidator extends BaseStringValidator implem throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Password mismatching.", "The password the user has entered does not match the stored password.")); //NOI18N } */ - - // Trace message - //* NOISY-DEBUG: */ System.out.println("validate: EXIT!"); //NOI18N } } diff --git a/src/java/org/mxchange/addressbook/validator/privacy_terms/AddressbookPrivacyTermsCheckboxValidator.java b/src/java/org/mxchange/addressbook/validator/privacy_terms/AddressbookPrivacyTermsCheckboxValidator.java index 603981c5..1319cf56 100644 --- a/src/java/org/mxchange/addressbook/validator/privacy_terms/AddressbookPrivacyTermsCheckboxValidator.java +++ b/src/java/org/mxchange/addressbook/validator/privacy_terms/AddressbookPrivacyTermsCheckboxValidator.java @@ -38,16 +38,10 @@ public class AddressbookPrivacyTermsCheckboxValidator extends BaseBooleanValidat @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { - // Trace message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("validate: context={0},component={1},value={2} - CALLED!", context, component, value)); //NOI18N - // All accepted, required fields String[] requiredFields = {"privacy", "terms"}; //NOI18N // Pre-validation (example: not null, not a string, empty string ...) super.preValidate(context, component, value, requiredFields, false); - - // Trace message - //* NOISY-DEBUG: */ System.out.println("validate: EXIT!"); //NOI18N } } -- 2.39.5