[hibernate-issues] [Hibernate-JIRA] Updated: (HV-35) Add a "trim" attribute to @NotEmpty

Sanne Grinovero (JIRA) noreply at atlassian.com
Sun Mar 30 11:17:33 EDT 2008


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

Sanne Grinovero updated HV-35:
------------------------------

    Attachment: validator-NotEmpty-trimcapability.patch

This is a proposed patch on the 3.0.0ga tag.

Besides the new feature it contains a logic CHANGE, I'm sorry I coulnd't separate them as they are on the same lines of code.
It changes the API, but as it is just avoiding a ClassCastException I hope you'll not consider it a problem,
as I hope nobody is relying on that.

Basically it also solved:
http://opensource.atlassian.com/projects/hibernate/browse/HV-23
returning false instead of throwing a ClassCastException, so to behave exactly as most other validators do
when applied on unsupported value types.

I have done some nice junit tests which are not included, as they depend on other code I have sent for
http://opensource.atlassian.com/projects/hibernate/browse/HV-52

I'm sorry for the patch-messy,
I'll attach another patch if it helps containig it all (new feature + new test framework + tests for this feature)

> Add a "trim" attribute to @NotEmpty
> -----------------------------------
>
>                 Key: HV-35
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-35
>             Project: Hibernate Validator
>          Issue Type: New Feature
>          Components: validators
>    Affects Versions: 3.0.0.ga
>            Reporter: Mike Youngstrom
>             Fix For: 3.0.1
>
>         Attachments: validator-NotEmpty-trimcapability.patch
>
>
> Frequently where an empty string is invalid so would " " be invalid.  I think  trim attribute added to @NotEmpty(trim=true) would be a simple and useful addition.

-- 
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