Skip to content

Commit 43944bb

Browse files
committed
HV-2035 Remove deprecated org.hibernate.validator.constraints.Email constraint
1 parent 0571695 commit 43944bb

File tree

35 files changed

+5
-213
lines changed

35 files changed

+5
-213
lines changed

annotation-processor/src/test/java/org/hibernate/validator/ap/ConstraintValidationProcessorIT.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ public void hibernateValidatorProvidedCustomConstraints() {
159159
assertFalse( compilationResult );
160160
assertThatDiagnosticsMatch(
161161
diagnostics,
162+
new DiagnosticExpectation( Kind.ERROR, 64 ),
163+
new DiagnosticExpectation( Kind.ERROR, 65 ),
162164
new DiagnosticExpectation( Kind.ERROR, 66 ),
163165
new DiagnosticExpectation( Kind.ERROR, 67 ),
164166
new DiagnosticExpectation( Kind.ERROR, 68 ),
@@ -174,10 +176,7 @@ public void hibernateValidatorProvidedCustomConstraints() {
174176
new DiagnosticExpectation( Kind.ERROR, 78 ),
175177
new DiagnosticExpectation( Kind.ERROR, 79 ),
176178
new DiagnosticExpectation( Kind.ERROR, 80 ),
177-
new DiagnosticExpectation( Kind.ERROR, 81 ),
178-
new DiagnosticExpectation( Kind.ERROR, 82 ),
179-
new DiagnosticExpectation( Kind.ERROR, 83 ),
180-
new DiagnosticExpectation( Kind.ERROR, 84 )
179+
new DiagnosticExpectation( Kind.ERROR, 81 )
181180
);
182181
}
183182

annotation-processor/src/test/java/org/hibernate/validator/ap/testmodel/customconstraints/HibernateValidatorProvidedCustomConstraints.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import java.util.Date;
1111

1212
import org.hibernate.validator.constraints.CreditCardNumber;
13-
import org.hibernate.validator.constraints.Email;
1413
import org.hibernate.validator.constraints.Length;
1514
import org.hibernate.validator.constraints.LuhnCheck;
1615
import org.hibernate.validator.constraints.Mod10Check;
@@ -38,7 +37,6 @@ public class HibernateValidatorProvidedCustomConstraints {
3837
* Allowed.
3938
*/
4039
@CreditCardNumber
41-
@Email
4240
@Length
4341
@LuhnCheck
4442
@ModCheck(modType = ModCheck.ModType.MOD10, multiplier = 2)
@@ -64,7 +62,6 @@ public class HibernateValidatorProvidedCustomConstraints {
6462
* Not allowed.
6563
*/
6664
@CreditCardNumber
67-
@Email
6865
@Length
6966
@LuhnCheck
7067
@ModCheck(modType = ModCheck.ModType.MOD10, multiplier = 2)

engine/src/main/java/org/hibernate/validator/constraints/Email.java

Lines changed: 0 additions & 72 deletions
This file was deleted.

engine/src/main/java/org/hibernate/validator/internal/constraintvalidators/hv/EmailValidator.java

Lines changed: 0 additions & 20 deletions
This file was deleted.

engine/src/main/java/org/hibernate/validator/internal/metadata/core/BuiltinConstraint.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ enum BuiltinConstraint {
5555
// Hibernate Validator specific constraints
5656
ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_CODE_POINT_LENGTH( "org.hibernate.validator.constraints.CodePointLength" ),
5757
ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_CURRENCY( "org.hibernate.validator.constraints.Currency" ),
58-
ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_EMAIL( "org.hibernate.validator.constraints.Email", Arrays.asList( JAKARTA_VALIDATION_CONSTRAINTS_PATTERN ) ),
5958
ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_ISBN( "org.hibernate.validator.constraints.ISBN" ),
6059
ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_LENGTH( "org.hibernate.validator.constraints.Length" ),
6160
ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_LUHN_CHECK( "org.hibernate.validator.constraints.LuhnCheck" ),

engine/src/main/java/org/hibernate/validator/internal/metadata/core/ConstraintHelper.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import static org.hibernate.validator.internal.metadata.core.BuiltinConstraint.ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_CREDIT_CARD_NUMBER;
3737
import static org.hibernate.validator.internal.metadata.core.BuiltinConstraint.ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_CURRENCY;
3838
import static org.hibernate.validator.internal.metadata.core.BuiltinConstraint.ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_EAN;
39-
import static org.hibernate.validator.internal.metadata.core.BuiltinConstraint.ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_EMAIL;
4039
import static org.hibernate.validator.internal.metadata.core.BuiltinConstraint.ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_ISBN;
4140
import static org.hibernate.validator.internal.metadata.core.BuiltinConstraint.ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_KOR_KORRRN;
4241
import static org.hibernate.validator.internal.metadata.core.BuiltinConstraint.ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_LENGTH;
@@ -762,9 +761,6 @@ protected Map<Class<? extends Annotation>, List<? extends ConstraintValidatorDes
762761
if ( enabledBuiltinConstraints.contains( ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_EAN ) ) {
763762
putBuiltinConstraint( tmpConstraints, EAN.class, EANValidator.class );
764763
}
765-
if ( enabledBuiltinConstraints.contains( ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_EMAIL ) ) {
766-
putBuiltinConstraint( tmpConstraints, org.hibernate.validator.constraints.Email.class, org.hibernate.validator.internal.constraintvalidators.hv.EmailValidator.class );
767-
}
768764
if ( enabledBuiltinConstraints.contains( ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_ISBN ) ) {
769765
putBuiltinConstraint( tmpConstraints, ISBN.class, ISBNValidator.class );
770766
}

engine/src/main/resources/org/hibernate/validator/ValidationMessages.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jakarta.validation.constraints.Size.message = size must be between {m
2424
org.hibernate.validator.constraints.CreditCardNumber.message = invalid credit card number
2525
org.hibernate.validator.constraints.Currency.message = invalid currency (must be one of {value})
2626
org.hibernate.validator.constraints.EAN.message = invalid {type} barcode
27-
org.hibernate.validator.constraints.Email.message = not a well-formed email address
2827
org.hibernate.validator.constraints.ISBN.message = invalid ISBN
2928
org.hibernate.validator.constraints.Length.message = length must be between {min} and {max}
3029
org.hibernate.validator.constraints.CodePointLength.message = length must be between {min} and {max}

engine/src/main/resources/org/hibernate/validator/ValidationMessages_ar.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jakarta.validation.constraints.Size.message = \u064a\u062c\u0628 \u0623\u
1717

1818
org.hibernate.validator.constraints.CreditCardNumber.message = \u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062a\u0645\u0627\u0646 \u063a\u064a\u0631 \u0635\u0627\u0644\u062d
1919
org.hibernate.validator.constraints.EAN.message = \u0627\u0644\u0634\u0641\u0631\u0629 {type} \u063a\u064a\u0631 \u0635\u0627\u0644\u062d\u0629
20-
org.hibernate.validator.constraints.Email.message = \u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0628\u0631\u064a\u062f \u0627\u0644\u0625\u0644\u0643\u062a\u0631\u0648\u0646\u064a \u063a\u064a\u0631 \u0645\u0631\u0643\u0628 \u0628\u0634\u0643\u0644 \u062c\u064a\u062f
2120
org.hibernate.validator.constraints.Length.message = \u0627\u0644\u0637\u0648\u0644 \u064a\u062c\u0628 \u0623\u0646 \u064a\u0643\u0648\u0646 \u0628\u064a\u0646 {min} \u0648{max}
2221
org.hibernate.validator.constraints.CodePointLength.message = \u0627\u0644\u0637\u0648\u0644 \u064a\u062c\u0628 \u0623\u0646 \u064a\u0643\u0648\u0646 \u0628\u064a\u0646 {min} \u0648{max}
2322
org.hibernate.validator.constraints.NotBlank.message = \u0644\u0627 \u064a\u0645\u0643\u0646 \u0623\u0646 \u062a\u0643\u0648\u0646 \u0641\u0627\u0631\u063a\u0629

engine/src/main/resources/org/hibernate/validator/ValidationMessages_cs.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jakarta.validation.constraints.Size.message = velikost mus\u00ed le\u
2424
org.hibernate.validator.constraints.CreditCardNumber.message = neplatn\u00e9 \u010d\u00edslo kreditn\u00ed karty
2525
org.hibernate.validator.constraints.Currency.message = neplatn\u00e1 m\u011bna (mus\u00ed m\u00edt jednu z hodnot {value})
2626
org.hibernate.validator.constraints.EAN.message = neplatn\u00fd \u010d\u00e1rov\u00fd k\u00f3d {type}
27-
org.hibernate.validator.constraints.Email.message = mus\u00ed m\u00edt spr\u00e1vn\u011b utvo\u0159enou e-mailovou adresu
2827
org.hibernate.validator.constraints.ISBN.message = neplatn\u00e9 ISBN
2928
org.hibernate.validator.constraints.Length.message = d\u00e9lka mus\u00ed le\u017eet v rozsahu {min} a\u017e {max}
3029
org.hibernate.validator.constraints.CodePointLength.message = d\u00e9lka mus\u00ed le\u017eet v rozsahu {min} a\u017e {max}

engine/src/main/resources/org/hibernate/validator/ValidationMessages_da.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jakarta.validation.constraints.Size.message = st\u00f8r
2424
org.hibernate.validator.constraints.CreditCardNumber.message = ugyldigt kreditkortnummer
2525
org.hibernate.validator.constraints.Currency.message = ugyldig valuta (skal v\u00e6re en af {value})
2626
org.hibernate.validator.constraints.EAN.message = ugyldig {type} stregkode
27-
org.hibernate.validator.constraints.Email.message = ikke en velformuleret email adresse
2827
org.hibernate.validator.constraints.ISBN.message = ugyldigt ISBN
2928
org.hibernate.validator.constraints.Length.message = l\u00e6ngden skal v\u00e6re mellem {min} og {max}
3029
org.hibernate.validator.constraints.CodePointLength.message = l\u00e6ngden skal v\u00e6re mellem {min} og {max}

0 commit comments

Comments
 (0)