]
Hardy Ferentschik resolved HV-376.
----------------------------------
Resolution: Fixed
validateValue() and validateProperty() are too restrictive regarding
processable property names
-----------------------------------------------------------------------------------------------
Key: HV-376
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HV-376
Project: Hibernate Validator
Issue Type: Bug
Components: engine
Affects Versions: 4.2.0.Beta1
Reporter: Gunnar Morling
Assignee: Kevin Pollet
Priority: Minor
Fix For: 4.2.0.CR1
The methods Validator#validateValue() and Validator#validateProperty() expect the name of
a bean property, for which constraint validation should be performed.
Currently not all valid Java property (field/method) identifiers are supported here, as
the specified property name is processed in PathImpl with a regular expression, that
matches only the word character class (A-Za-z0-9_), causing the evaluation of uncommon but
yet valid property names such as the following ones to fail:
* private String höchstBetrag; // German Umlaute such as "ö" are allowed in
Java identifiers
* private String €Amount; // some currency signs such as "€" are allowed,
sigh
* private String höchst\u00f6Betrag; // specifying letters such as "ö" using
Unicode is allowed
Trying to do so results in the following exception:
{code:java}
java.lang.IllegalArgumentException: Unable to parse property path ö
at org.hibernate.validator.engine.PathImpl.parseProperty(PathImpl.java:216)
at org.hibernate.validator.engine.PathImpl.createPathFromString(PathImpl.java:64)
at org.hibernate.validator.engine.ValidatorImpl.validateValue(ValidatorImpl.java:152)
{code}
More information on the identifiers allowed in the Java language can be found in [JLS,
chapter
3.8|http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.8].
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: