Skip to content

HV-1831 experiments (6.2) #1169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 94 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
32e58c9
HV-1763 Adjust performance profiles and add a benchmark for executable
gsmet Apr 9, 2020
69100d8
HV-1763 Improve performances of ExecutableHelper#getSignature()
gsmet Apr 9, 2020
28328a4
HV-1763 Avoid calling ExecutableHelper#getSignature() twice
gsmet Apr 9, 2020
c32c52b
HV-1763 Switch to a string less approach for signature generation
gsmet Apr 9, 2020
d2562e3
HV-1764 Upgrade Jackson test dependencies to 2.10.3
gsmet Apr 10, 2020
65c54b2
HV-1765 Upgrade WildFly versions to 18.0.1 and 19.0.0
gsmet Apr 10, 2020
1969957
HV-1765 Adjust javafx module installation for incontainer tests
gsmet Apr 10, 2020
9f0b149
[Jenkins release job] README.md updated by release build 6.1.3.Final
Hibernate-CI Apr 10, 2020
ec2d496
[Jenkins release job] changelog.txt updated by release build 6.1.3.Final
Hibernate-CI Apr 10, 2020
0276343
[Jenkins release job] Preparing release 6.1.3.Final
Hibernate-CI Apr 10, 2020
e7481a8
[Jenkins release job] Preparing next development iteration
Hibernate-CI Apr 10, 2020
9436434
HV-1767 Reduce the overhead of ConstraintHelper initialization in the…
gsmet Apr 15, 2020
301f87a
HV-1767 Remove unused method from ConstraintHelper
gsmet Apr 15, 2020
95a1810
HV-1767 Optimize how optional features are detected
gsmet Apr 16, 2020
fca1e49
HV-1770 Rename method for more clarity before doing more changes
gsmet Apr 16, 2020
c84093b
HV-1770 Relax constraint consistency checking for built-in constraints
gsmet Apr 16, 2020
ea74084
HV-1769 Only create the default TraversableResolver if none has been …
gsmet Apr 16, 2020
a4818b4
HV-1760 Clean up Min/Max/... implementations for CharSequence
gsmet Apr 17, 2020
2ab7c75
HV-1760 Support CharSequence for Negative/Positive/...
gsmet Apr 17, 2020
66abd3e
HV-1760 Fix javadoc for *OrZero validators
gsmet Apr 17, 2020
cc2b358
[Jenkins release job] README.md updated by release build 6.1.4.Final
Hibernate-CI Apr 17, 2020
15a57c6
[Jenkins release job] changelog.txt updated by release build 6.1.4.Final
Hibernate-CI Apr 17, 2020
de380ed
[Jenkins release job] Preparing release 6.1.4.Final
Hibernate-CI Apr 17, 2020
86bd5ad
[Jenkins release job] Preparing next development iteration
Hibernate-CI Apr 17, 2020
5966686
HV-1771 Fix DecimalMin message German translation
Br4ndysv3n Apr 27, 2020
c067767
HV-1772 Allow overriding MessageInterpolator when config is reused
gsmet Apr 29, 2020
c1b392f
HV-1773 Be more explicit about issues with EL injection and how to av…
gsmet Apr 30, 2020
438a0fc
HV-1774 Test arbitrary code injection through buildConstraintViolatio…
yrodiere Feb 24, 2020
6ae28a1
HV-1774 Do not interpret '$\A{1+1}' in message templates
yrodiere Feb 24, 2020
d3b39a7
HV-1774 Add a few tests to demonstrate the behavior of TokenCollector
yrodiere Feb 25, 2020
5415140
HV-1774 Fix an invalid error message for unbalanced '{'/'}'
yrodiere Feb 25, 2020
c2e89a9
[Jenkins release job] README.md updated by release build 6.1.5.Final
Hibernate-CI May 6, 2020
69e43b6
[Jenkins release job] changelog.txt updated by release build 6.1.5.Final
Hibernate-CI May 6, 2020
8bd23be
[Jenkins release job] Preparing release 6.1.5.Final
Hibernate-CI May 6, 2020
db05d72
[Jenkins release job] Preparing next development iteration
Hibernate-CI May 6, 2020
038f0f0
HV-1782 Remove trailing dot from @Max constraint German translation
gsmet Jun 2, 2020
423ecc1
HV-1780 Add @Normalized contraint that validates unicode normalizatio…
candrews May 19, 2020
51186fe
HV-1761 fix interpolation of primitive arrays
agatsenko Jun 30, 2020
cd0e9a5
HV-1795 Remove link to JavaMoney javadoc
gsmet Jul 23, 2020
69b1ce3
HV-1802 Update ByteBuddy test dependency to 1.10.16
gsmet Sep 28, 2020
caf79c1
HV-1803 Move the tests to log4j2
gsmet Sep 28, 2020
a45b9d5
HV-1804 Fix Dutch translation for @Size constraint
jpraet Sep 28, 2020
9513ebd
HV-1797 Consider parameter metadata when enabling cycle detection
gsmet Sep 30, 2020
ec7876e
[Jenkins release job] README.md updated by release build 6.1.6.Final
Hibernate-CI Sep 30, 2020
1089ade
[Jenkins release job] changelog.txt updated by release build 6.1.6.Final
Hibernate-CI Sep 30, 2020
daa8a1e
[Jenkins release job] Preparing release 6.1.6.Final
Hibernate-CI Sep 30, 2020
faadf5d
[Jenkins release job] Preparing next development iteration
Hibernate-CI Sep 30, 2020
c22cdfc
HV-1807 Add Maven profile to improve contributor experience on Intell…
yrodiere Sep 30, 2020
1f02245
HV-1811 Upgrade to Bean Validation TCK 2.0.6
yrodiere Oct 2, 2020
9137187
HV-1809 Upgrade to TestNG 6.14.3
yrodiere Sep 30, 2020
bef4601
HV-1809 Fix the Security Manager policy following the TestNG upgrade
yrodiere Oct 1, 2020
0e878cd
HV-1809 Disable parallel test execution in the tck-runner following t…
yrodiere Oct 1, 2020
d818550
HV-1810 Upgrade to Arquillian 1.6.0.Final
yrodiere Sep 30, 2020
11696b8
HV-1810 Upgrade to payara-arquillian 2.3.1
yrodiere Oct 1, 2020
5693642
HV-1810 Include TestNG and dependencies in the Payara deployment in F…
yrodiere Oct 1, 2020
207d4c2
HV-1806 Upgrade to pax-url 2.5.4
yrodiere Sep 29, 2020
d23bdaf
HV-1806 Make sure Karaf-based tests use the same local Maven reposito…
yrodiere Sep 29, 2020
66966c7
HV-1806 Make sure that Shrinkwrap-based tests use the same local Mave…
yrodiere Sep 29, 2020
cd42a5a
HV-1805 Add suffixes to test reports to more easily distinguish betwe…
yrodiere Oct 1, 2020
70687f3
HV-1805 Copy and adapt Jenkinsfile from Hibernate Search
yrodiere Sep 28, 2020
f57403a
HV-1805 Disable fail-fast in Jenkinsfile
yrodiere Sep 29, 2020
e504de2
HV-1805 Run the TCK with WildFly in the Jenkinsfile
yrodiere Sep 30, 2020
863d611
HV-1805 Pass -DdeployAtEnd=true when deploying snapshots in the Jenki…
yrodiere Oct 1, 2020
4b6762b
HV-1805 Run sigtests and JQAssistant as part of the default Jenkinsfi…
yrodiere Oct 6, 2020
d4d8239
HV-1805 Disable JDK15/JDK16 builds in Jenkinsfile because of JDK-8253566
yrodiere Oct 8, 2020
6c579c7
Re-enable JDK16 testing in Jenkinsfile
yrodiere Oct 20, 2020
8648431
HV-1814 Bump JUnit from 4.12 to 4.13.1
dependabot[bot] Oct 12, 2020
3aed882
HV-1815 Fix DecimalMax and DecimalMin in zh_CN translation
roger-jm Oct 31, 2020
5cb52c1
Set version to 6.2.0-SNAPSHOT
gsmet Dec 4, 2020
1403c1f
HV-1817 Fix style issues
yrodiere Dec 1, 2020
56d443d
HV-1817 Upgrade to checkstyle 8.38
yrodiere Dec 1, 2020
e076293
HV-1816 Disable Expression Language by default for custom constraint …
gsmet Nov 25, 2020
d2db40b
HV-1816 Limit the EL features exposed by default
gsmet Nov 25, 2020
93c7dd7
HV-1812 Avoid reflection-based metadata extraction for built-in value…
gsmet Oct 14, 2020
55a24f3
HV-1790 Remove the SafeHtml constraint and the jsoup dependency
gsmet Jul 15, 2020
1fd1a3e
HV-1819 Upgrade Classmate to 1.5.1
gsmet Dec 7, 2020
1785054
HV-1820 Upgrade JBoss Logging to 3.4.1.Final
gsmet Dec 7, 2020
7232226
[Jenkins release job] README.md updated by release build 6.2.0.CR1
Hibernate-CI Dec 7, 2020
401a85d
[Jenkins release job] changelog.txt updated by release build 6.2.0.CR1
Hibernate-CI Dec 7, 2020
02ed74e
[Jenkins release job] Preparing release 6.2.0.CR1
Hibernate-CI Dec 7, 2020
9c61b95
[Jenkins release job] Preparing next development iteration
Hibernate-CI Dec 7, 2020
3304647
HV-1821 Support using a non-Hibernate Validator configuration class
gsmet Dec 16, 2020
d8c8faa
HV-1822 add russian specific INN annotation
Boiarshinov Dec 20, 2020
ff4faab
[Jenkins release job] README.md updated by release build 6.2.0.Final
Hibernate-CI Dec 23, 2020
badcc8f
[Jenkins release job] changelog.txt updated by release build 6.2.0.Final
Hibernate-CI Dec 23, 2020
a883dcd
[Jenkins release job] Preparing release 6.2.0.Final
Hibernate-CI Dec 23, 2020
c314630
[Jenkins release job] Preparing next development iteration
Hibernate-CI Dec 23, 2020
0eb0e17
HV-1831 Unfinished experiments
gsmet Feb 24, 2021
d4acd34
HV-1831 Add a couple of examples illustrating various cases
gsmet Feb 25, 2021
aea0642
HV-1831 Clean up another experiment that shouldn't have been committed
gsmet Mar 8, 2021
cea9b8c
Add the same bean to List twice
gbadner Mar 10, 2021
f4d7656
Copy nodes when changing the nature of the leaf
gsmet Mar 11, 2021
e859ea7
HV-1831 : Experiment detecting cycles in bean classes
gbadner Apr 9, 2021
21d7d7b
Correct checkstyle failures
gbadner Apr 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
576 changes: 576 additions & 0 deletions Jenkinsfile

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hibernate Validator

*Version: 6.1.2.Final - 31-01-2020*
*Version: 6.2.0.Final - 23-12-2020*


## What is it?
Expand Down Expand Up @@ -35,7 +35,7 @@ Logging will delegate any log requests to that provider.
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.1.2.Final</version>
<version>6.2.0.Final</version>
</dependency>

You also need an API and implementation of the Unified Expression Language. These dependencies must be explicitly added in an SE environment.
Expand All @@ -54,7 +54,7 @@ extension by adding the following dependency:
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator-cdi</artifactId>
<version>6.1.2.Final</version>
<version>6.2.0.Final</version>
</dependency>

* _hibernate-validator-annotation-processor-&lt;version&gt;.jar_ is an optional jar which can be integrated with your build
Expand Down
2 changes: 1 addition & 1 deletion annotation-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator-parent</artifactId>
<version>6.1.3-SNAPSHOT</version>
<version>6.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,10 @@ public ConstraintHelper(Types typeUtils, AnnotationApiHelper annotationApiHelper
registerAllowedTypesForBuiltInConstraint( HibernateValidatorTypes.REGON_CHECK, CharSequence.class );
registerAllowedTypesForBuiltInConstraint( HibernateValidatorTypes.NIP_CHECK, CharSequence.class );
registerAllowedTypesForBuiltInConstraint( HibernateValidatorTypes.PESEL_CHECK, CharSequence.class );
registerAllowedTypesForBuiltInConstraint( HibernateValidatorTypes.INN_CHECK, CharSequence.class );
registerAllowedTypesForBuiltInConstraint( HibernateValidatorTypes.NOT_BLANK, CharSequence.class );
registerAllowedTypesForBuiltInConstraint( HibernateValidatorTypes.NOT_EMPTY, TYPES_SUPPORTED_BY_SIZE_AND_NOT_EMPTY_ANNOTATIONS );
registerAllowedTypesForBuiltInConstraint( HibernateValidatorTypes.SAFE_HTML, CharSequence.class );
registerAllowedTypesForBuiltInConstraint( HibernateValidatorTypes.NORMALIZED, CharSequence.class );
registerAllowedTypesForBuiltInConstraint( HibernateValidatorTypes.SCRIPT_ASSERT, Object.class );
registerAllowedTypesForBuiltInConstraint( HibernateValidatorTypes.UNIQUE_ELEMENTS, Collection.class );
registerAllowedTypesForBuiltInConstraint( HibernateValidatorTypes.URL, CharSequence.class );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ public static class HibernateValidatorTypes {
public static final String REGON_CHECK = ORG_HIBERNATE_VALIDATOR_CONSTRAINTS + ".pl.REGON";
public static final String NIP_CHECK = ORG_HIBERNATE_VALIDATOR_CONSTRAINTS + ".pl.NIP";
public static final String PESEL_CHECK = ORG_HIBERNATE_VALIDATOR_CONSTRAINTS + ".pl.PESEL";
public static final String INN_CHECK = ORG_HIBERNATE_VALIDATOR_CONSTRAINTS + ".ru.INN";
public static final String NORMALIZED = ORG_HIBERNATE_VALIDATOR_CONSTRAINTS + ".Normalized";
public static final String NOT_BLANK = ORG_HIBERNATE_VALIDATOR_CONSTRAINTS + ".NotBlank";
public static final String NOT_EMPTY = ORG_HIBERNATE_VALIDATOR_CONSTRAINTS + ".NotEmpty";
public static final String SAFE_HTML = ORG_HIBERNATE_VALIDATOR_CONSTRAINTS + ".SafeHtml";
public static final String SCRIPT_ASSERT = ORG_HIBERNATE_VALIDATOR_CONSTRAINTS + ".ScriptAssert";
public static final String UNIQUE_ELEMENTS = ORG_HIBERNATE_VALIDATOR_CONSTRAINTS + ".UniqueElements";
public static final String URL = ORG_HIBERNATE_VALIDATOR_CONSTRAINTS + ".URL";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.hibernate.validator.ap.testmodel.ModelWithJava8DateTime;
import org.hibernate.validator.ap.testmodel.ModelWithJavaMoneyTypes;
import org.hibernate.validator.ap.testmodel.ModelWithJodaTypes;
import org.hibernate.validator.ap.testmodel.ModelWithNormalizedConstraints;
import org.hibernate.validator.ap.testmodel.ModelWithUniqueElementsConstraints;
import org.hibernate.validator.ap.testmodel.ModelWithoutConstraints;
import org.hibernate.validator.ap.testmodel.MultipleConstraintsOfSameType;
Expand Down Expand Up @@ -154,6 +155,8 @@ public void hibernateValidatorProvidedCustomConstraints() {
assertFalse( compilationResult );
assertThatDiagnosticsMatch(
diagnostics,
new DiagnosticExpectation( Kind.ERROR, 66 ),
new DiagnosticExpectation( Kind.ERROR, 67 ),
new DiagnosticExpectation( Kind.ERROR, 68 ),
new DiagnosticExpectation( Kind.ERROR, 69 ),
new DiagnosticExpectation( Kind.ERROR, 70 ),
Expand All @@ -170,10 +173,7 @@ public void hibernateValidatorProvidedCustomConstraints() {
new DiagnosticExpectation( Kind.ERROR, 81 ),
new DiagnosticExpectation( Kind.ERROR, 82 ),
new DiagnosticExpectation( Kind.ERROR, 83 ),
new DiagnosticExpectation( Kind.ERROR, 84 ),
new DiagnosticExpectation( Kind.ERROR, 85 ),
new DiagnosticExpectation( Kind.ERROR, 86 ),
new DiagnosticExpectation( Kind.ERROR, 87 )
new DiagnosticExpectation( Kind.ERROR, 84 )
);
}

Expand Down Expand Up @@ -724,6 +724,25 @@ public void codePointLengthConstraints() {
);
}

@Test
@TestForIssue(jiraKey = "HV-1780")
public void normalizedConstraints() {
File[] sourceFiles = new File[] {
compilerHelper.getSourceFile( ModelWithNormalizedConstraints.class )
};

boolean compilationResult =
compilerHelper.compile( new ConstraintValidationProcessor(), diagnostics, false, true, sourceFiles );

assertFalse( compilationResult );
assertThatDiagnosticsMatch(
diagnostics,
new DiagnosticExpectation( Kind.ERROR, 17 ),
new DiagnosticExpectation( Kind.ERROR, 20 ),
new DiagnosticExpectation( Kind.ERROR, 23 )
);
}

@Test
public void isbnConstraints() {
File[] sourceFiles = new File[] {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Hibernate Validator, declare and validate application constraints
*
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package org.hibernate.validator.ap.testmodel;

import java.util.Collection;
import java.util.List;
import java.util.Set;

import org.hibernate.validator.constraints.Normalized;

public class ModelWithNormalizedConstraints {

@Normalized
public Collection<String> collection;

@Normalized
public List<String> list;

@Normalized
public Set<String> set;

@Normalized
public String string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.Range;
import org.hibernate.validator.constraints.SafeHtml;
import org.hibernate.validator.constraints.ScriptAssert;
import org.hibernate.validator.constraints.URL;
import org.hibernate.validator.constraints.br.CNPJ;
Expand Down Expand Up @@ -48,7 +47,6 @@ public class HibernateValidatorProvidedCustomConstraints {
@NotBlank
@NotEmpty
@Range
@SafeHtml
@URL
@CNPJ
@CPF
Expand All @@ -75,7 +73,6 @@ public class HibernateValidatorProvidedCustomConstraints {
@NotBlank
@NotEmpty
@Range
@SafeHtml
@URL
@CNPJ
@CPF
Expand Down
2 changes: 1 addition & 1 deletion build-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator-parent</artifactId>
<version>6.1.3-SNAPSHOT</version>
<version>6.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
6 changes: 3 additions & 3 deletions cdi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator-parent</artifactId>
<version>6.1.3-SNAPSHOT</version>
<version>6.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -67,8 +67,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
83 changes: 83 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,89 @@
Hibernate Validator Changelog
=============================

6.2.0.Final (23-12-2020)
-------------------------

** Bug
* HV-1821 - engine - HV-1755 introduces NPE in org.hibernate.validator.internal.engine.ValidatorFactoryImpl constructor

** New Feature
* HV-1822 - validators - Add Russian specific validator for russian taxpayer identification number

6.2.0.CR1 (07-12-2020)
-------------------------

** Improvement
* HV-1812 - engine - Avoid reflection-based metadata extraction for built-in value extractors

** New Feature
* HV-1816 - engine - Disable Expression Language by default for custom constraint violations

** Remove Feature
* HV-1790 - engine, validators - Remove the SafeHtml constraint

** Task
* HV-1820 - engine - Upgrade JBoss Logging to 3.4.1.Final
* HV-1819 - engine - Upgrade Classmate to 1.5.1
* HV-1817 - build - Upgrade to checkstyle 8.38

6.1.6.Final (30-09-2020)
-------------------------

** Bug
* HV-1804 - translations - Fix Dutch translation for @Size constraint
* HV-1797 - validators - Validation on classes with a bidirectional relationship cause stack overflow on 6.1.x
* HV-1761 - engine - Interpolation of primitive arrays causes a ClassCastException

** Improvement
* HV-1782 - translations - Remove trailing dot from @Max constraint German translation

** New Feature
* HV-1780 - validators - Add @Normalized contraint that validates if text is normalized in a given form

** Task
* HV-1803 - tests - Move the tests to log4j2
* HV-1802 - tests - Update ByteBuddy test dependency to 1.10.16
* HV-1795 - build - Remove link to JavaMoney javadoc

6.1.5.Final (06-05-2020)
-------------------------

** Bug
* HV-1774 - engine - Invalid parsing of EL expression can lead to invalid EL expressions considered valid
* HV-1772 - engine - Building multiple ValidatorFactory instances from a single Configuration violates specification for MessageInterpolator
* HV-1771 - translations - Fix DecimalMin message German translation

** Improvement
* HV-1773 - documentation - Be more explicit about issues with EL injection and how to avoid them

6.1.4.Final (17-04-2020)
-------------------------

** Bug
* HV-1760 - validators - @Negative*/@Positive* do not support CharSequence as documented

** Improvement
* HV-1770 - engine - Relax constraint consistency checking for built-in constraints
* HV-1769 - engine - Only create the default TraversableResolver if none has been specified
* HV-1767 - engine - Reduce the overhead of ConstraintHelper initialization in the predefined scope case

6.1.3.Final (10-04-2020)
-------------------------

** Bug
* HV-1758 - translations - Extra dollar sign in validation messages for ModCheck

** Improvement
* HV-1763 - engine - Improve performances of ExecutableHelper#getSignature

** New Feature
* HV-1755 - engine - Introduce the notion of BeanMetaDataClassNormalizer in the standard ValidatorFactory

** Task
* HV-1765 - integration - Upgrade WildFly versions to 18.0.1.Final and 19.0.0.Final
* HV-1764 - tests - Upgrade Jackson test dependencies to 2.10.3

6.1.2.Final (31-01-2020)
-------------------------

Expand Down
12 changes: 4 additions & 8 deletions distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator-parent</artifactId>
<version>6.1.3-SNAPSHOT</version>
<version>6.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -50,8 +50,8 @@

<!-- Need to list out optional dependencies here again in order to include them via assembly dependency set -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
<dependency>
<groupId>jakarta.persistence</groupId>
Expand All @@ -65,10 +65,6 @@
<groupId>javax.money</groupId>
<artifactId>money-api</artifactId>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
</dependency>
<dependency>
<groupId>com.thoughtworks.paranamer</groupId>
<artifactId>paranamer</artifactId>
Expand Down Expand Up @@ -119,7 +115,7 @@
<link>${java.api-docs.base-url}</link>
<link>${javaee.api-docs.base-url}</link>
<link>${bv.api-docs.base-url}</link>
<link>${javamoney.api-docs.base-url}</link>
<!--<link>${javamoney.api-docs.base-url}</link>-->
</links>
<tags>
<tag>
Expand Down
3 changes: 1 addition & 2 deletions distribution/src/main/assembly/dist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@
<dependencySet>
<outputDirectory>dist/lib/optional</outputDirectory>
<includes>
<include>log4j:log4j</include>
<include>org.apache.logging.log4j:log4j-core</include>
<include>joda-time:joda-time</include>
<include>jakarta.persistence:jakarta.persistence-api</include>
<include>org.jsoup:jsoup</include>
<include>com.thoughtworks.paranamer:paranamer</include>
</includes>
</dependencySet>
Expand Down
2 changes: 1 addition & 1 deletion documentation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator-parent</artifactId>
<version>6.1.3-SNAPSHOT</version>
<version>6.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
14 changes: 9 additions & 5 deletions documentation/src/main/asciidoc/ch02.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -707,15 +707,14 @@ With one exception also these constraints apply to the field/property level, onl
Supported data types::: `CharSequence`
Hibernate metadata impact::: None

`@Normalized(form=)`:: Validates that the annotated character sequence is normalized according to the given `form`.
Supported data types::: `CharSequence`
Hibernate metadata impact::: None

`@Range(min=, max=)`:: Checks whether the annotated value lies between (inclusive) the specified minimum and maximum
Supported data types::: `BigDecimal`, `BigInteger`, `CharSequence`, `byte`, `short`, `int`, `long` and the respective wrappers of the primitive types
Hibernate metadata impact::: None

`@SafeHtml(whitelistType= , additionalTags=, additionalTagsWithAttributes=, baseURI=)`:: Checks whether the annotated value contains potentially malicious fragments such as `<script/>`. In order to use this constraint, the http://jsoup.org/[jsoup] library must be part of the class path. With the `whitelistType` attribute a predefined whitelist type can be chosen which can be refined via `additionalTags` or `additionalTagsWithAttributes`. The former allows to add tags without any attributes, whereas the latter allows to specify tags and optionally allowed attributes as well as accepted protocols for the attributes using the annotation `@SafeHtml.Tag`.
In addition, `baseURI` allows to specify the base URI used to resolve relative URIs.
Supported data types::: `CharSequence`
Hibernate metadata impact::: None

`@ScriptAssert(lang=, script=, alias=, reportOn=)`:: Checks whether the given script can successfully be evaluated against the annotated element. In order to use this constraint, an implementation of the Java Scripting API as defined by JSR 223 ("Scripting for the Java^TM^ Platform") must be a part of the class path. The expressions to be evaluated can be written in any scripting or expression language, for which a JSR 223 compatible engine can be found in the class path. Even though this is a class-level constraint, one can use the `reportOn` attribute to report a constraint violation on a specific property rather than the whole object.
Supported data types::: Any type
Hibernate metadata impact::: None
Expand Down Expand Up @@ -769,6 +768,11 @@ Hibernate Validator!
Hibernate metadata impact::: None
Country::: Poland

`@INN`:: Checks that the annotated character sequence represents a Russian taxpayer identification number (https://ru.wikipedia.org/wiki/%D0%98%D0%B4%D0%B5%D0%BD%D1%82%D0%B8%D1%84%D0%B8%D0%BA%D0%B0%D1%86%D0%B8%D0%BE%D0%BD%D0%BD%D1%8B%D0%B9_%D0%BD%D0%BE%D0%BC%D0%B5%D1%80_%D0%BD%D0%B0%D0%BB%D0%BE%D0%B3%D0%BE%D0%BF%D0%BB%D0%B0%D1%82%D0%B5%D0%BB%D1%8C%D1%89%D0%B8%D0%BA%D0%B0[INN]). Can be applied to both individual and juridical versions of INN
Supported data types::: `CharSequence`
Hibernate metadata impact::: None
Country::: Russia

[TIP]
====
In some cases neither the Jakarta Bean Validation constraints nor the custom constraints provided by
Expand Down
13 changes: 13 additions & 0 deletions documentation/src/main/asciidoc/ch04.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@ context:
`format(String format, Object... args)` which behaves like
`java.util.Formatter.format(String format, Object... args)`.

Expression Language is very flexible and Hibernate Validator offers several feature levels
that you can use to enable Expression Language features through the `ExpressionLanguageFeatureLevel` enum:

* `NONE`: Expression Language interpolation is fully disabled.
* `VARIABLES`: Allow interpolation of the variables injected via `addExpressionVariable()`, resources bundles and usage of the `formatter` object.
* `BEAN_PROPERTIES`: Allow everything `VARIABLES` allows plus the interpolation of bean properties.
* `BEAN_METHODS`: Also allow execution of bean methods. Can be considered safe for hardcoded constraint messages but not for <<section-hibernateconstraintvalidatorcontext, custom violations>>
where extra care is required.

The default feature level for constraint messages is `BEAN_PROPERTIES`.

You can define the Expression Language feature level when <<el-features, bootstrapping the `ValidatorFactory`>>.

The following section provides several examples for using EL expressions in error messages.

==== Examples
Expand Down
Loading