[
https://issues.apache.org/jira/browse/BVAL-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852403#action_12852403
]
Carlos Vara commented on BVAL-12:
---------------------------------
Hi Roman,
great! I just started testing your implementation 2 days ago, and it worked
quite well actually. It's very nice to see that you decided to implement this
feature, as I think it is a great addition to the spec. I will probably migrate
one project that I'm working on from hibernate validator to Apache
BeanValidation just for this feature, so I will keep providing feedback.
> Current implementation of method validation (appendix C of JSR-303) doesn't
> work with some constraints
> ------------------------------------------------------------------------------------------------------
>
> Key: BVAL-12
> URL: https://issues.apache.org/jira/browse/BVAL-12
> Project: BeanValidation
> Issue Type: Improvement
> Components: jsr303
> Affects Versions: 0.1-incubating
> Reporter: Carlos Vara
> Assignee: Roman Stumm
> Attachments: method-validation.diff, ParameterAccess.java,
> ReturnAccess.java
>
> Original Estimate: 0.5h
> Remaining Estimate: 0.5h
>
> The methods processAnnotation and processAnnotations in
> MethodValidatorMetaBeanFactory don't have enough information to infer the the
> parameter/return value types, so they default to the type of the class that
> contains the methods. Because of this, the selection of the correct validator
> throws an exception (for example with a @Size constraint), or works in a
> suboptimal manner (it always selects NotEmptyValidator instead of for
> example NotEmptyValidatorForString when validating a String).
> To fix it, I have created two new AccessStrategies (ParameterAccess and
> ReturnAccess), and modified the processAnnotation and processAnnotations
> signatures to take the strategies as parameters so they can pass them to the
> Jsr303MetaBeanFactory.applyConstraint method (which at the moment receives a
> null).
> I attach the fix, along with a few more tests that check that constraints
> such as @Size or @Pattern can be applied to method parameters and return
> types.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.