Skip to content

Commit 562f7b2

Browse files
committed
HV-2036 Remove deprecated org.hibernate.validator.constraints.NotBlank constraint
1 parent 43944bb commit 562f7b2

34 files changed

+7
-203
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, 62 ),
163+
new DiagnosticExpectation( Kind.ERROR, 63 ),
162164
new DiagnosticExpectation( Kind.ERROR, 64 ),
163165
new DiagnosticExpectation( Kind.ERROR, 65 ),
164166
new DiagnosticExpectation( Kind.ERROR, 66 ),
@@ -173,10 +175,7 @@ public void hibernateValidatorProvidedCustomConstraints() {
173175
new DiagnosticExpectation( Kind.ERROR, 75 ),
174176
new DiagnosticExpectation( Kind.ERROR, 76 ),
175177
new DiagnosticExpectation( Kind.ERROR, 77 ),
176-
new DiagnosticExpectation( Kind.ERROR, 78 ),
177-
new DiagnosticExpectation( Kind.ERROR, 79 ),
178-
new DiagnosticExpectation( Kind.ERROR, 80 ),
179-
new DiagnosticExpectation( Kind.ERROR, 81 )
178+
new DiagnosticExpectation( Kind.ERROR, 78 )
180179
);
181180
}
182181

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.NotBlank;
1918
import org.hibernate.validator.constraints.NotEmpty;
2019
import org.hibernate.validator.constraints.Range;
2120
import org.hibernate.validator.constraints.ScriptAssert;
@@ -42,7 +41,6 @@ public class HibernateValidatorProvidedCustomConstraints {
4241
@ModCheck(modType = ModCheck.ModType.MOD10, multiplier = 2)
4342
@Mod10Check
4443
@Mod11Check
45-
@NotBlank
4644
@NotEmpty
4745
@Range
4846
@URL
@@ -67,7 +65,6 @@ public class HibernateValidatorProvidedCustomConstraints {
6765
@ModCheck(modType = ModCheck.ModType.MOD10, multiplier = 2)
6866
@Mod10Check
6967
@Mod11Check
70-
@NotBlank
7168
@NotEmpty
7269
@Range
7370
@URL

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

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

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

Lines changed: 0 additions & 38 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_BLANK( "org.hibernate.validator.constraints.NotBlank",
69-
Arrays.asList( JAKARTA_VALIDATION_CONSTRAINTS_NOT_NULL ) ),
7068
ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_NOT_EMPTY( "org.hibernate.validator.constraints.NotEmpty",
7169
Arrays.asList( JAKARTA_VALIDATION_CONSTRAINTS_NOT_NULL, JAKARTA_VALIDATION_CONSTRAINTS_SIZE ) ),
7270
ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_PARAMETER_SCRIPT_ASSERT( "org.hibernate.validator.constraints.ParameterScriptAssert" ),

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_BLANK;
4847
import static org.hibernate.validator.internal.metadata.core.BuiltinConstraint.ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_NOT_EMPTY;
4948
import static org.hibernate.validator.internal.metadata.core.BuiltinConstraint.ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_PARAMETER_SCRIPT_ASSERT;
5049
import static org.hibernate.validator.internal.metadata.core.BuiltinConstraint.ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_PL_NIP;
@@ -788,9 +787,6 @@ protected Map<Class<? extends Annotation>, List<? extends ConstraintValidatorDes
788787
if ( enabledBuiltinConstraints.contains( ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_PL_NIP ) ) {
789788
putBuiltinConstraint( tmpConstraints, NIP.class, NIPValidator.class );
790789
}
791-
if ( enabledBuiltinConstraints.contains( ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_NOT_BLANK ) ) {
792-
putBuiltinConstraint( tmpConstraints, org.hibernate.validator.constraints.NotBlank.class, org.hibernate.validator.internal.constraintvalidators.hv.NotBlankValidator.class );
793-
}
794790
if ( enabledBuiltinConstraints.contains( ORG_HIBERNATE_VALIDATOR_CONSTRAINTS_NOT_EMPTY ) ) {
795791
putBuiltinConstraint( tmpConstraints, org.hibernate.validator.constraints.NotEmpty.class );
796792
}

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.NotBlank.message = may not be empty
3635
org.hibernate.validator.constraints.NotEmpty.message = may not be empty
3736
org.hibernate.validator.constraints.ParametersScriptAssert.message = script expression "{script}" didn't evaluate to true
3837
org.hibernate.validator.constraints.Range.message = 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
@@ -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.NotBlank.message = \u0644\u0627 \u064a\u0645\u0643\u0646 \u0623\u0646 \u062a\u0643\u0648\u0646 \u0641\u0627\u0631\u063a\u0629
2322
org.hibernate.validator.constraints.NotEmpty.message = \u0644\u0627 \u064a\u0645\u0643\u0646 \u0623\u0646 \u062a\u0643\u0648\u0646 \u0641\u0627\u0631\u063a\u0629
2423
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
2524
org.hibernate.validator.constraints.Range.message = \u064a\u062c\u0628 \u0623\u0646 \u064a\u0643\u0648\u0646 \u0628\u064a\u0646 {min} \u0648{max}

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.NotBlank.message = nesm\u00ed b\u00fdt pr\u00e1zdn\u00e1
3534
org.hibernate.validator.constraints.NotEmpty.message = nesm\u00ed b\u00fdt pr\u00e1zdn\u00e1
3635
org.hibernate.validator.constraints.ParametersScriptAssert.message = v\u00fdraz skriptu "{script}" se nevyhodnotil na true
3736
org.hibernate.validator.constraints.Range.message = 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
@@ -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.NotBlank.message = m\u00e5 ikke v\u00e6re tomt
3534
org.hibernate.validator.constraints.NotEmpty.message = m\u00e5 ikke v\u00e6re tomt
3635
org.hibernate.validator.constraints.ParametersScriptAssert.message = script udtryk "{script}" evaluerede ikke til true
3736
org.hibernate.validator.constraints.Range.message = skal v\u00e6re mellem {min} og {max}

0 commit comments

Comments
 (0)