diff --git a/src/main/java/net/contargo/types/telephony/validation/ValidPhoneNumberValidator.java b/src/main/java/net/contargo/types/telephony/validation/ValidPhoneNumberValidator.java index be3096f..d69184f 100644 --- a/src/main/java/net/contargo/types/telephony/validation/ValidPhoneNumberValidator.java +++ b/src/main/java/net/contargo/types/telephony/validation/ValidPhoneNumberValidator.java @@ -1,5 +1,6 @@ package net.contargo.types.telephony.validation; +import net.contargo.types.Loggable; import net.contargo.types.telephony.PhoneNumber; import org.apache.commons.lang.StringUtils; @@ -14,7 +15,7 @@ * @author Robin Jayasinghe - jayasinghe@synyx.de * @author Olle Törnström - toernstroem@synyx.de */ -public class ValidPhoneNumberValidator implements ConstraintValidator { +public class ValidPhoneNumberValidator implements ConstraintValidator, Loggable { private static final int PHONE_NUMBER_SIZE = 64; @@ -51,8 +52,9 @@ public boolean isValid(String value, ConstraintValidatorContext cvc) { } if (!phoneNumber.isValidNumber()) { - reportConstraintViolation(cvc, "{PHONE_NUMBER_VALID}"); - isValid = false; + // TODO: to be discussed if the phone numbers has to be validated harder. currently only log info if the number is not valid. + logger().info("PHONE_NUMBER_INVALID - the given number '{}' ist not valid!", + phoneNumber.getRawPhoneNumber()); } }