[hibernate-issues] [Hibernate-JIRA] Commented: (BVAL-285) ValidatorFactory#close should clearly state post condidtions

Hardy Ferentschik (JIRA) noreply at atlassian.com
Fri Mar 30 10:30:50 EDT 2012


    [ https://hibernate.onjira.com/browse/BVAL-285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46133#comment-46133 ] 

Hardy Ferentschik commented on BVAL-285:
----------------------------------------

my problem is that you are saying that something is not allowed. IMO one has in this case to specify what happens if you still do it. Otherwise you are better off saying "the behavior of the ValidatorFactory and all Validator instances created by this factory is undefined after _close_ is called. It is recommended to not call any method on these instances after the factory got closed"

> ValidatorFactory#close should clearly state post condidtions 
> -------------------------------------------------------------
>
>                 Key: BVAL-285
>                 URL: https://hibernate.onjira.com/browse/BVAL-285
>             Project: Bean Validation
>          Issue Type: Improvement
>          Components: spec-general
>    Affects Versions: 1.1.next
>            Reporter: Hardy Ferentschik
>
> The Javadocs for ValidatorFactory#close says:
> {quote}
> After the _ValidatorFactory_ instance is closed, it is not allowed to call:
> * methods of this _ValidatorFactory_ instance
> * methods of _Validator_ instances created by this _ValidatorFactory_
> {quote}
> It does, however, not specified what happens if such a method is called. I think with this wording a post conditions needs to be specified, eg a _ValidationException_ will be thrown. Otherwise the docs should say that the behavior is unspecified if any of the mentioned methods is called after calling _close()_

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list