Skip to content

Commit 2b898c8

Browse files
committed
HV-2037 Remove deprecated org.hibernate.validator.constraints.NotEmpty constraint
1 parent 562f7b2 commit 2b898c8

33 files changed

+5
-238
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, 60 ),
163+
new DiagnosticExpectation( Kind.ERROR, 61 ),
162164
new DiagnosticExpectation( Kind.ERROR, 62 ),
163165
new DiagnosticExpectation( Kind.ERROR, 63 ),
164166
new DiagnosticExpectation( Kind.ERROR, 64 ),
@@ -172,10 +174,7 @@ public void hibernateValidatorProvidedCustomConstraints() {
172174
new DiagnosticExpectation( Kind.ERROR, 72 ),
173175
new DiagnosticExpectation( Kind.ERROR, 73 ),
174176
new DiagnosticExpectation( Kind.ERROR, 74 ),
175-
new DiagnosticExpectation( Kind.ERROR, 75 ),
176-
new DiagnosticExpectation( Kind.ERROR, 76 ),
177-
new DiagnosticExpectation( Kind.ERROR, 77 ),
178-
new DiagnosticExpectation( Kind.ERROR, 78 )
177+
new DiagnosticExpectation( Kind.ERROR, 75 )
179178
);
180179
}
181180

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
@@ -15,7 +15,6 @@
1515
import org.hibernate.validator.constraints.Mod10Check;
1616
import org.hibernate.validator.constraints.Mod11Check;
1717
import org.hibernate.validator.constraints.ModCheck;
18-
import org.hibernate.validator.constraints.NotEmpty;
1918
import org.hibernate.validator.constraints.Range;
2019
import org.hibernate.validator.constraints.ScriptAssert;
2120
import org.hibernate.validator.constraints.URL;
@@ -41,7 +40,6 @@ public class HibernateValidatorProvidedCustomConstraints {
4140
@ModCheck(modType = ModCheck.ModType.MOD10, multiplier = 2)
4241
@Mod10Check
4342
@Mod11Check
44-
@NotEmpty
4543
@Range
4644
@URL
4745
@CNPJ
@@ -65,7 +63,6 @@ public class HibernateValidatorProvidedCustomConstraints {
6563
@ModCheck(modType = ModCheck.ModType.MOD10, multiplier = 2)
6664
@Mod10Check
6765
@Mod11Check
68-
@NotEmpty
6966
@Range
7067
@URL
7168
@CNPJ

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

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

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ enum BuiltinConstraint {
6565
ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_MOD_CHECK( "org.hibernate.validator.constraints.ModCheck" ),
6666
ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_NORMALIZED( "org.hibernate.validator.constraints.Normalized" ),
6767
ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_EAN( "org.hibernate.validator.constraints.EAN", Arrays.asList( ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_MOD10_CHECK ) ),
68-
ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_NOT_EMPTY( "org.hibernate.validator.constraints.NotEmpty",
69-
Arrays.asList( JAKARTA_VALIDATION_CONSTRAINTS_NOT_NULL, JAKARTA_VALIDATION_CONSTRAINTS_SIZE ) ),
7068
ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_PARAMETER_SCRIPT_ASSERT( "org.hibernate.validator.constraints.ParameterScriptAssert" ),
7169
ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_RANGE( "org.hibernate.validator.constraints.Range",
7270
Arrays.asList( JAKARTA_VALIDATION_CONSTRAINTS_MIN, JAKARTA_VALIDATION_CONSTRAINTS_MAX ) ),

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
@@ -44,7 +44,6 @@
4444
import static org.hibernate.validator.internal.metadata.core.BuiltinConstraint.ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_MOD11_CHECK;
4545
import static org.hibernate.validator.internal.metadata.core.BuiltinConstraint.ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_MOD_CHECK;
4646
import static org.hibernate.validator.internal.metadata.core.BuiltinConstraint.ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_NORMALIZED;
47-
import static org.hibernate.validator.internal.metadata.core.BuiltinConstraint.ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_NOT_EMPTY;
4847
import static org.hibernate.validator.internal.metadata.core.BuiltinConstraint.ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_PARAMETER_SCRIPT_ASSERT;
4948
import static org.hibernate.validator.internal.metadata.core.BuiltinConstraint.ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_PL_NIP;
5049
import static org.hibernate.validator.internal.metadata.core.BuiltinConstraint.ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_PL_PESEL;
@@ -787,9 +786,6 @@ protected Map<Class<? extends Annotation>, List<? extends ConstraintValidatorDes
787786
if ( enabledBuiltinConstraints.contains( ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_PL_NIP ) ) {
788787
putBuiltinConstraint( tmpConstraints, NIP.class, NIPValidator.class );
789788
}
790-
if ( enabledBuiltinConstraints.contains( ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_NOT_EMPTY ) ) {
791-
putBuiltinConstraint( tmpConstraints, org.hibernate.validator.constraints.NotEmpty.class );
792-
}
793789
if ( enabledBuiltinConstraints.contains( ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_PARAMETER_SCRIPT_ASSERT ) ) {
794790
putBuiltinConstraint( tmpConstraints, ParameterScriptAssert.class, ParameterScriptAssertValidator.class );
795791
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ org.hibernate.validator.constraints.Mod10Check.message = the check
3232
org.hibernate.validator.constraints.Mod11Check.message = the check digit for ${validatedValue} is invalid, Modulo 11 checksum failed
3333
org.hibernate.validator.constraints.ModCheck.message = the check digit for ${validatedValue} is invalid, {modType} checksum failed
3434
org.hibernate.validator.constraints.Normalized.message = must be normalized
35-
org.hibernate.validator.constraints.NotEmpty.message = may not be empty
3635
org.hibernate.validator.constraints.ParametersScriptAssert.message = script expression "{script}" didn't evaluate to true
3736
org.hibernate.validator.constraints.Range.message = must be between {min} and {max}
3837
org.hibernate.validator.constraints.ScriptAssert.message = script expression "{script}" didn't evaluate to true

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ org.hibernate.validator.constraints.CreditCardNumber.message = \u0631\u06
1919
org.hibernate.validator.constraints.EAN.message = \u0627\u0644\u0634\u0641\u0631\u0629 {type} \u063a\u064a\u0631 \u0635\u0627\u0644\u062d\u0629
2020
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}
2121
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}
22-
org.hibernate.validator.constraints.NotEmpty.message = \u0644\u0627 \u064a\u0645\u0643\u0646 \u0623\u0646 \u062a\u0643\u0648\u0646 \u0641\u0627\u0631\u063a\u0629
2322
org.hibernate.validator.constraints.ParametersScriptAssert.message = \u0627\u0644\u062a\u0639\u0628\u064a\u0631 \u0627\u0644\u0646\u0635\u064a "{script}" \u0644\u0645 \u064a\u062a\u0645 \u062a\u0642\u064a\u064a\u0645\u0647 \u0635\u062d\u064a\u062d\u0627
2423
org.hibernate.validator.constraints.Range.message = \u064a\u062c\u0628 \u0623\u0646 \u064a\u0643\u0648\u0646 \u0628\u064a\u0646 {min} \u0648{max}
2524
org.hibernate.validator.constraints.ScriptAssert.message = \u0627\u0644\u062a\u0639\u0628\u064a\u0631 \u0627\u0644\u0646\u0635\u064a "{script}" \u0644\u0645 \u064a\u062a\u0645 \u062a\u0642\u064a\u064a\u0645\u0647 \u0635\u062d\u064a\u062d\u0627

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ org.hibernate.validator.constraints.LuhnCheck.message = kontroln\u
3131
org.hibernate.validator.constraints.Mod10Check.message = kontroln\u00ed \u010d\u00edslice pro ${validatedValue} je neplatn\u00e1, kontroln\u00ed sou\u010det Modulo 10 se nezda\u0159il
3232
org.hibernate.validator.constraints.Mod11Check.message = kontroln\u00ed \u010d\u00edslice pro ${validatedValue} je neplatn\u00e1, kontroln\u00ed sou\u010det Modulo 11 se nezda\u0159il
3333
org.hibernate.validator.constraints.ModCheck.message = kontroln\u00ed \u010d\u00edslice pro ${validatedValue} je neplatn\u00e1, kontroln\u00ed sou\u010det {modType} se nezda\u0159il
34-
org.hibernate.validator.constraints.NotEmpty.message = nesm\u00ed b\u00fdt pr\u00e1zdn\u00e1
3534
org.hibernate.validator.constraints.ParametersScriptAssert.message = v\u00fdraz skriptu "{script}" se nevyhodnotil na true
3635
org.hibernate.validator.constraints.Range.message = mus\u00ed le\u017eet v rozsahu {min} a\u017e {max}
3736
org.hibernate.validator.constraints.ScriptAssert.message = v\u00fdraz skriptu "{script}" se nevyhodnotil na true

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ org.hibernate.validator.constraints.LuhnCheck.message = kontrolciff
3131
org.hibernate.validator.constraints.Mod10Check.message = kontrolcifferet for ${validatedValue} er ugyldigt, Modulo 10 checksum mislykkedes
3232
org.hibernate.validator.constraints.Mod11Check.message = kontrolcifferet for ${validatedValue} er ugyldigt, Modulo 11 checksum mislykkedes
3333
org.hibernate.validator.constraints.ModCheck.message = kontrolcifferet for ${validatedValue} er ugyldigt, {modType} checksummet mislykkedes
34-
org.hibernate.validator.constraints.NotEmpty.message = m\u00e5 ikke v\u00e6re tomt
3534
org.hibernate.validator.constraints.ParametersScriptAssert.message = script udtryk "{script}" evaluerede ikke til true
3635
org.hibernate.validator.constraints.Range.message = skal v\u00e6re mellem {min} og {max}
3736
org.hibernate.validator.constraints.ScriptAssert.message = script udtryk "{script}" evaluerede ikke til true

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ org.hibernate.validator.constraints.LuhnCheck.message = die Pr\u00
3131
org.hibernate.validator.constraints.Mod10Check.message = die Pr\u00fcfziffer f\u00fcr ${validatedValue} ist ung\u00fcltig, Modulo 10-Kontrollsumme ist fehlgeschlagen
3232
org.hibernate.validator.constraints.Mod11Check.message = die Pr\u00fcfziffer f\u00fcr ${validatedValue} ist ung\u00fcltig, Modulo 11-Kontrollsumme ist fehlgeschlagen
3333
org.hibernate.validator.constraints.ModCheck.message = die Pr\u00fcfziffer f\u00fcr ${validatedValue} ist ung\u00fcltig, {modType}-Kontrollsumme ist fehlgeschlagen
34-
org.hibernate.validator.constraints.NotEmpty.message = darf nicht leer sein
3534
org.hibernate.validator.constraints.ParametersScriptAssert.message = die Evaluierung des Scriptausdrucks "{script}" ergab nicht true
3635
org.hibernate.validator.constraints.Range.message = muss zwischen {min} und {max} sein
3736
org.hibernate.validator.constraints.ScriptAssert.message = die Evaluierung des Scriptausdrucks "{script}" ergab nicht true

0 commit comments

Comments
 (0)