]> git.mxchange.org Git - jjobs-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sun, 20 Aug 2017 19:49:49 +0000 (21:49 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 20 Aug 2017 20:01:18 +0000 (22:01 +0200)
- throwing a ConverterException in a validator is wrong, maybe copy-paste did it?
- added TODO for getting rid of wrong constructor in birthday validator
- renamed variable

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jjobs/validator/birthday/JobsBirthdayValidator.java
src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java
src/java/org/mxchange/jjobs/validator/phone/abroad/JobsAbroadDialValidator.java

index ffeff2aa8bf182ac2f4edb24233177425844f6a7..131cb59509726208a46902b9db06327f4c8d0f9a 100644 (file)
@@ -44,6 +44,7 @@ public class JobsBirthdayValidator extends BaseDateValidator implements Validato
 
        /**
         * Default constructor
+        * @TODO Get rid of this
         */
        public JobsBirthdayValidator () {
                // Try to get it
index a9fb9e703f2a6c0d937567386f5fbfbe3bffb7e7..c6bf66ae5daf15fcbd4c5c8bb00523467f9806a4 100644 (file)
@@ -21,7 +21,6 @@ import java.util.regex.Pattern;
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
-import javax.faces.convert.ConverterException;
 import javax.faces.validator.FacesValidator;
 import javax.faces.validator.Validator;
 import javax.faces.validator.ValidatorException;
@@ -131,7 +130,7 @@ public class JobsEmailAddressValidator extends BaseStringValidator implements Va
                                JobsEmailAddressValidator.CONTACT_BEAN = (ContactSessionBeanRemote) initialContext.lookup("java:global/jjobs-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
                        } catch (final NamingException ex) {
                                // Continue to throw it
-                               throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
+                               throw new ValidatorException(new FacesMessage(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage())), ex); //NOI18N
                        }
                }
 
index 4e7d12d0079c52736fb476ddc43fca13cb8d603c..1cab199ad01f806076593e1e6ee39c769f3bea2e 100644 (file)
@@ -47,14 +47,14 @@ public class JobsAbroadDialValidator extends BaseObjectValidator implements Vali
                super.preValidate(context, component, value, requiredFields, true);
 
                // Parse value as string first
-               String dial = String.valueOf(value);
+               String dialNumber = String.valueOf(value);
 
                // Is it not +?
-               if (!dial.equals("+")) { //NOI18N
+               if (!dialNumber.equals("+")) { //NOI18N
                        // No, then try to ...
                        try {
                                // ..parse as number
-                               Long number = Long.parseLong(dial);
+                               Long number = Long.parseLong(dialNumber);
 
                                // Not valid range? (1 - 99, very rude)
                                if (number < 1 || number > 99) {