--- /dev/null
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.addressbook.validator.password;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.FacesValidator;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+import javax.inject.Inject;
+import org.mxchange.jcoreee.validator.string.BaseStringValidator;
+import org.mxchange.jusercore.container.login.LoginContainer;
+import org.mxchange.jusercore.container.login.UserLoginContainer;
+import org.mxchange.jusercore.model.user.UserUtils;
+import org.mxchange.addressbook.beans.login.AddressbookUserLoginWebSessionController;
+
+/**
+ * A validator for validating passwords (if they match with stored)
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@FacesValidator (value = "UserPasswordValidator")
+public class AddressbookUserPasswordValidator extends BaseStringValidator implements Validator {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 48_581_795_687_317L;
+
+ /**
+ * User login controller
+ */
+ @Inject
+ private AddressbookUserLoginWebSessionController loginController;
+
+ @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
+
+ // Pre-validation (example: not null, not a string, empty string ...)
+ super.preValidate(context, component, value, requiredFields, false);
+
+ // value is known to be an entered password, so instance login container
+ LoginContainer container = new UserLoginContainer(this.loginController.getLoggedInUser(), (String) value);
+
+ // Test it here
+ if (!UserUtils.ifPasswordMatches(container, this.loginController.getLoggedInUser())) {
+ // Password mismatches
+ 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
+ }
+}
+++ /dev/null
-/*
- * Copyright (C) 2016 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.addressbook.validators.password;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.validator.FacesValidator;
-import javax.faces.validator.Validator;
-import javax.faces.validator.ValidatorException;
-import javax.inject.Inject;
-import org.mxchange.jcoreee.validator.string.BaseStringValidator;
-import org.mxchange.jusercore.container.login.LoginContainer;
-import org.mxchange.jusercore.container.login.UserLoginContainer;
-import org.mxchange.jusercore.model.user.UserUtils;
-import org.mxchange.addressbook.beans.login.AddressbookUserLoginWebSessionController;
-
-/**
- * A validator for validating passwords (if they match with stored)
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-@FacesValidator (value = "UserPasswordValidator")
-public class AddressbookUserPasswordValidator extends BaseStringValidator implements Validator {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 48_581_795_687_317L;
-
- /**
- * User login controller
- */
- @Inject
- private AddressbookUserLoginWebSessionController loginController;
-
- @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
-
- // Pre-validation (example: not null, not a string, empty string ...)
- super.preValidate(context, component, value, requiredFields, false);
-
- // value is known to be an entered password, so instance login container
- LoginContainer container = new UserLoginContainer(this.loginController.getLoggedInUser(), (String) value);
-
- // Test it here
- if (!UserUtils.ifPasswordMatches(container, this.loginController.getLoggedInUser())) {
- // Password mismatches
- 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
- }
-}