[hibernate-issues] [Hibernate-JIRA] Issue Comment Edited: (HV-301) add a trim property to @NotEmpty please.

Hardy Ferentschik (JIRA) noreply at atlassian.com
Mon Mar 22 15:14:31 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HV-301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=35912#action_35912 ] 

Hardy Ferentschik edited comment on HV-301 at 3/22/10 2:12 PM:
---------------------------------------------------------------

@NotEmpty is not solely for strings. It can also be applied on collections, maps, arrays etc to test for emptiness. In all these cases a trimming flag does not make sense. See also HV-35 (which is an issue from the legacy validator). 
At best I could imagine a @NotBlank solely for strings.

      was (Author: hardy.ferentschik):
    @NotEmpty is not solely for strings. It can also be applied on collections, maps, arrays etc to test for emptiness. In all these cases a trimming flag does not make sense. See also HV-35 (which is an issue from the legacy validator). 

At best I could imagine a @NotBlank solely for strings.
  
> add a trim property to @NotEmpty please. 
> -----------------------------------------
>
>                 Key: HV-301
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-301
>             Project: Hibernate Validator
>          Issue Type: New Feature
>          Components: validators
>            Reporter: Ken Egervari
>            Assignee: Hardy Ferentschik
>             Fix For: 4.1.0-Beta-1
>
>
> You can set to false to make sure not to break anything, but this makes life easier so that it doesn't accept " " or "\n" and stuff like that, which to most people, still means "empty" (I am pressed to find many cases where it does not mean empty honestly).

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