[hibernate-issues] [Hibernate-JIRA] Assigned: (HV-376) validateValue() and validateProperty() are too restrictive regarding processable property names

Kevin Pollet (JIRA) noreply at atlassian.com
Mon Jan 31 11:27:05 EST 2011


     [ http://opensource.atlassian.com/projects/hibernate/browse/HV-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Pollet reassigned HV-376:
-------------------------------

    Assignee: Kevin Pollet

> 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.1.0.Final
>            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: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the hibernate-issues mailing list