You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bval.apache.org by "Sascha Vujevic (JIRA)" <ji...@apache.org> on 2011/05/13 12:39:47 UTC
[jira] [Created] (BVAL-95) Beanvalidation with Generic-DataTypes
Beanvalidation with Generic-DataTypes
-------------------------------------
Key: BVAL-95
URL: https://issues.apache.org/jira/browse/BVAL-95
Project: BeanValidation
Issue Type: Bug
Components: jsr303
Affects Versions: 0.2-incubating, 0.3-incubating
Environment: Windows XP, Java 1.6, Eclipse 1.6, Maven 3.0.3
Reporter: Sascha Vujevic
Fix For: 0.3-incubating
Attachments: Generic-Parameter-Patch.txt
MethodValidatorMetaBeanFactory.processAnnotation() fills in the methode applyConstraint() the AccessStrategy with Class<?> therefore Parameters of methodes with Generics won't find a Validator to validate them.
You will get an exception:
Caused by: javax.validation.UnexpectedTypeException: No validator could be found for type java.util.Map. See: @NotEmpty at org.apache.bval.jsr303.extensions.ParameterAccess@1d2f117
The parameter of the my method is Map<Object, Object>.
I have attached a patch-file.
I don't know i this is the best way to solve the problem or if there is allready a patch or i use the validation in a wrong way.
Thank you.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (BVAL-95) Beanvalidation with Generic-DataTypes
Posted by "Sascha Vujevic (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BVAL-95?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sascha Vujevic updated BVAL-95:
-------------------------------
Attachment: Generic-Paramter-Patch_Update.txt
Some code was missing.
> Beanvalidation with Generic-DataTypes
> -------------------------------------
>
> Key: BVAL-95
> URL: https://issues.apache.org/jira/browse/BVAL-95
> Project: BeanValidation
> Issue Type: Bug
> Components: jsr303
> Affects Versions: 0.2-incubating, 0.3-incubating
> Environment: Windows XP, Java 1.6, Eclipse 1.6, Maven 3.0.3
> Reporter: Sascha Vujevic
> Labels: patch
> Fix For: 0.3-incubating
>
> Attachments: Generic-Parameter-Patch.txt, Generic-Paramter-Patch_Update.txt
>
> Original Estimate: 5m
> Remaining Estimate: 5m
>
> MethodValidatorMetaBeanFactory.processAnnotation() fills in the methode applyConstraint() the AccessStrategy with Class<?> therefore Parameters of methodes with Generics won't find a Validator to validate them.
> You will get an exception:
> Caused by: javax.validation.UnexpectedTypeException: No validator could be found for type java.util.Map. See: @NotEmpty at org.apache.bval.jsr303.extensions.ParameterAccess@1d2f117
> The parameter of the my method is Map<Object, Object>.
> I have attached a patch-file.
> I don't know i this is the best way to solve the problem or if there is allready a patch or i use the validation in a wrong way.
> Thank you.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (BVAL-95) Beanvalidation with Generic-DataTypes
Posted by "Matt Benson (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BVAL-95?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matt Benson updated BVAL-95:
----------------------------
Fix Version/s: (was: 0.3-incubating)
0.4-incubating
> Beanvalidation with Generic-DataTypes
> -------------------------------------
>
> Key: BVAL-95
> URL: https://issues.apache.org/jira/browse/BVAL-95
> Project: BeanValidation
> Issue Type: Bug
> Components: method validation
> Affects Versions: 0.2-incubating, 0.3-incubating
> Environment: Windows XP, Java 1.6, Eclipse 1.6, Maven 3.0.3
> Reporter: Sascha Vujevic
> Labels: patch
> Fix For: 0.4-incubating
>
> Attachments: Generic-Parameter-Patch.txt, Generic-Paramter-Patch_Update.txt, emptyMap.jar
>
> Original Estimate: 5m
> Remaining Estimate: 5m
>
> MethodValidatorMetaBeanFactory.buildMethodConstraints() fill the ParameterAccess access with ParameterTypes. I think it must be method.getGenericParameterTypes().
> MethodValidatorMetaBeanFactory.processAnnotation() fills in the methode applyConstraint() the AccessStrategy with Class<?> therefore Parameters of methodes with Generics won't find a Validator to validate them.
> You will get an exception:
> Caused by: javax.validation.UnexpectedTypeException: No validator could be found for type java.util.Map. See: @NotEmpty at org.apache.bval.jsr303.extensions.ParameterAccess@1d2f117
> The parameter of the my method is Map<Object, Object>.
> I have attached a patch-file.
> I don't know i this is the best way to solve the problem or if there is allready a patch or i use the validation in a wrong way.
> Thank you.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (BVAL-95) Beanvalidation with Generic-DataTypes
Posted by "Matt Benson (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BVAL-95?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matt Benson updated BVAL-95:
----------------------------
Component/s: (was: jsr303)
method validation
> Beanvalidation with Generic-DataTypes
> -------------------------------------
>
> Key: BVAL-95
> URL: https://issues.apache.org/jira/browse/BVAL-95
> Project: BeanValidation
> Issue Type: Bug
> Components: method validation
> Affects Versions: 0.2-incubating, 0.3-incubating
> Environment: Windows XP, Java 1.6, Eclipse 1.6, Maven 3.0.3
> Reporter: Sascha Vujevic
> Labels: patch
> Fix For: 0.3-incubating
>
> Attachments: Generic-Parameter-Patch.txt, Generic-Paramter-Patch_Update.txt, emptyMap.jar
>
> Original Estimate: 5m
> Remaining Estimate: 5m
>
> MethodValidatorMetaBeanFactory.buildMethodConstraints() fill the ParameterAccess access with ParameterTypes. I think it must be method.getGenericParameterTypes().
> MethodValidatorMetaBeanFactory.processAnnotation() fills in the methode applyConstraint() the AccessStrategy with Class<?> therefore Parameters of methodes with Generics won't find a Validator to validate them.
> You will get an exception:
> Caused by: javax.validation.UnexpectedTypeException: No validator could be found for type java.util.Map. See: @NotEmpty at org.apache.bval.jsr303.extensions.ParameterAccess@1d2f117
> The parameter of the my method is Map<Object, Object>.
> I have attached a patch-file.
> I don't know i this is the best way to solve the problem or if there is allready a patch or i use the validation in a wrong way.
> Thank you.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (BVAL-95) Beanvalidation with Generic-DataTypes
Posted by "Sascha Vujevic (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BVAL-95?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sascha Vujevic updated BVAL-95:
-------------------------------
Attachment: emptyMap.jar
I have attached a Project wich inlcudes a JUnitTest (EmptyMapValidationTest).
I hope this will help.
Thank you for your help.
> Beanvalidation with Generic-DataTypes
> -------------------------------------
>
> Key: BVAL-95
> URL: https://issues.apache.org/jira/browse/BVAL-95
> Project: BeanValidation
> Issue Type: Bug
> Components: jsr303
> Affects Versions: 0.2-incubating, 0.3-incubating
> Environment: Windows XP, Java 1.6, Eclipse 1.6, Maven 3.0.3
> Reporter: Sascha Vujevic
> Labels: patch
> Fix For: 0.3-incubating
>
> Attachments: Generic-Parameter-Patch.txt, Generic-Paramter-Patch_Update.txt, emptyMap.jar
>
> Original Estimate: 5m
> Remaining Estimate: 5m
>
> MethodValidatorMetaBeanFactory.buildMethodConstraints() fill the ParameterAccess access with ParameterTypes. I think it must be method.getGenericParameterTypes().
> MethodValidatorMetaBeanFactory.processAnnotation() fills in the methode applyConstraint() the AccessStrategy with Class<?> therefore Parameters of methodes with Generics won't find a Validator to validate them.
> You will get an exception:
> Caused by: javax.validation.UnexpectedTypeException: No validator could be found for type java.util.Map. See: @NotEmpty at org.apache.bval.jsr303.extensions.ParameterAccess@1d2f117
> The parameter of the my method is Map<Object, Object>.
> I have attached a patch-file.
> I don't know i this is the best way to solve the problem or if there is allready a patch or i use the validation in a wrong way.
> Thank you.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BVAL-95) Beanvalidation with Generic-DataTypes
Posted by "Matt Benson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BVAL-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13034082#comment-13034082 ]
Matt Benson commented on BVAL-95:
---------------------------------
There is a sandbox "pseudo-branch" of bval at svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/ , which uses some type handling code from the forthcoming release of commons-lang 3.0 to improve the generics handling throughout the bval codebase. Your test seems to work for me using that code, so this issue should be fixed in due time.
> Beanvalidation with Generic-DataTypes
> -------------------------------------
>
> Key: BVAL-95
> URL: https://issues.apache.org/jira/browse/BVAL-95
> Project: BeanValidation
> Issue Type: Bug
> Components: jsr303
> Affects Versions: 0.2-incubating, 0.3-incubating
> Environment: Windows XP, Java 1.6, Eclipse 1.6, Maven 3.0.3
> Reporter: Sascha Vujevic
> Labels: patch
> Fix For: 0.3-incubating
>
> Attachments: Generic-Parameter-Patch.txt, Generic-Paramter-Patch_Update.txt, emptyMap.jar
>
> Original Estimate: 5m
> Remaining Estimate: 5m
>
> MethodValidatorMetaBeanFactory.buildMethodConstraints() fill the ParameterAccess access with ParameterTypes. I think it must be method.getGenericParameterTypes().
> MethodValidatorMetaBeanFactory.processAnnotation() fills in the methode applyConstraint() the AccessStrategy with Class<?> therefore Parameters of methodes with Generics won't find a Validator to validate them.
> You will get an exception:
> Caused by: javax.validation.UnexpectedTypeException: No validator could be found for type java.util.Map. See: @NotEmpty at org.apache.bval.jsr303.extensions.ParameterAccess@1d2f117
> The parameter of the my method is Map<Object, Object>.
> I have attached a patch-file.
> I don't know i this is the best way to solve the problem or if there is allready a patch or i use the validation in a wrong way.
> Thank you.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (BVAL-95) Beanvalidation with Generic-DataTypes
Posted by "Matt Benson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BVAL-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13033056#comment-13033056 ]
Matt Benson commented on BVAL-95:
---------------------------------
I'm not really sure about this patch (specifically calling access.getClass() seems wrong). Could you first provide a failing unit test to show where the current code breaks down?
> Beanvalidation with Generic-DataTypes
> -------------------------------------
>
> Key: BVAL-95
> URL: https://issues.apache.org/jira/browse/BVAL-95
> Project: BeanValidation
> Issue Type: Bug
> Components: jsr303
> Affects Versions: 0.2-incubating, 0.3-incubating
> Environment: Windows XP, Java 1.6, Eclipse 1.6, Maven 3.0.3
> Reporter: Sascha Vujevic
> Labels: patch
> Fix For: 0.3-incubating
>
> Attachments: Generic-Parameter-Patch.txt, Generic-Paramter-Patch_Update.txt
>
> Original Estimate: 5m
> Remaining Estimate: 5m
>
> MethodValidatorMetaBeanFactory.buildMethodConstraints() fill the ParameterAccess access with ParameterTypes. I think it must be method.getGenericParameterTypes().
> MethodValidatorMetaBeanFactory.processAnnotation() fills in the methode applyConstraint() the AccessStrategy with Class<?> therefore Parameters of methodes with Generics won't find a Validator to validate them.
> You will get an exception:
> Caused by: javax.validation.UnexpectedTypeException: No validator could be found for type java.util.Map. See: @NotEmpty at org.apache.bval.jsr303.extensions.ParameterAccess@1d2f117
> The parameter of the my method is Map<Object, Object>.
> I have attached a patch-file.
> I don't know i this is the best way to solve the problem or if there is allready a patch or i use the validation in a wrong way.
> Thank you.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (BVAL-95) Beanvalidation with Generic-DataTypes
Posted by "Sascha Vujevic (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BVAL-95?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sascha Vujevic updated BVAL-95:
-------------------------------
Description:
MethodValidatorMetaBeanFactory.buildMethodConstraints() fill the ParameterAccess access with ParameterTypes. I think it must be method.getGenericParameterTypes().
MethodValidatorMetaBeanFactory.processAnnotation() fills in the methode applyConstraint() the AccessStrategy with Class<?> therefore Parameters of methodes with Generics won't find a Validator to validate them.
You will get an exception:
Caused by: javax.validation.UnexpectedTypeException: No validator could be found for type java.util.Map. See: @NotEmpty at org.apache.bval.jsr303.extensions.ParameterAccess@1d2f117
The parameter of the my method is Map<Object, Object>.
I have attached a patch-file.
I don't know i this is the best way to solve the problem or if there is allready a patch or i use the validation in a wrong way.
Thank you.
was:
MethodValidatorMetaBeanFactory.processAnnotation() fills in the methode applyConstraint() the AccessStrategy with Class<?> therefore Parameters of methodes with Generics won't find a Validator to validate them.
You will get an exception:
Caused by: javax.validation.UnexpectedTypeException: No validator could be found for type java.util.Map. See: @NotEmpty at org.apache.bval.jsr303.extensions.ParameterAccess@1d2f117
The parameter of the my method is Map<Object, Object>.
I have attached a patch-file.
I don't know i this is the best way to solve the problem or if there is allready a patch or i use the validation in a wrong way.
Thank you.
> Beanvalidation with Generic-DataTypes
> -------------------------------------
>
> Key: BVAL-95
> URL: https://issues.apache.org/jira/browse/BVAL-95
> Project: BeanValidation
> Issue Type: Bug
> Components: jsr303
> Affects Versions: 0.2-incubating, 0.3-incubating
> Environment: Windows XP, Java 1.6, Eclipse 1.6, Maven 3.0.3
> Reporter: Sascha Vujevic
> Labels: patch
> Fix For: 0.3-incubating
>
> Attachments: Generic-Parameter-Patch.txt, Generic-Paramter-Patch_Update.txt
>
> Original Estimate: 5m
> Remaining Estimate: 5m
>
> MethodValidatorMetaBeanFactory.buildMethodConstraints() fill the ParameterAccess access with ParameterTypes. I think it must be method.getGenericParameterTypes().
> MethodValidatorMetaBeanFactory.processAnnotation() fills in the methode applyConstraint() the AccessStrategy with Class<?> therefore Parameters of methodes with Generics won't find a Validator to validate them.
> You will get an exception:
> Caused by: javax.validation.UnexpectedTypeException: No validator could be found for type java.util.Map. See: @NotEmpty at org.apache.bval.jsr303.extensions.ParameterAccess@1d2f117
> The parameter of the my method is Map<Object, Object>.
> I have attached a patch-file.
> I don't know i this is the best way to solve the problem or if there is allready a patch or i use the validation in a wrong way.
> Thank you.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (BVAL-95) Beanvalidation with Generic-DataTypes
Posted by "Sascha Vujevic (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BVAL-95?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sascha Vujevic updated BVAL-95:
-------------------------------
Attachment: Generic-Parameter-Patch.txt
Patch of the solution
> Beanvalidation with Generic-DataTypes
> -------------------------------------
>
> Key: BVAL-95
> URL: https://issues.apache.org/jira/browse/BVAL-95
> Project: BeanValidation
> Issue Type: Bug
> Components: jsr303
> Affects Versions: 0.2-incubating, 0.3-incubating
> Environment: Windows XP, Java 1.6, Eclipse 1.6, Maven 3.0.3
> Reporter: Sascha Vujevic
> Labels: patch
> Fix For: 0.3-incubating
>
> Attachments: Generic-Parameter-Patch.txt
>
> Original Estimate: 5m
> Remaining Estimate: 5m
>
> MethodValidatorMetaBeanFactory.processAnnotation() fills in the methode applyConstraint() the AccessStrategy with Class<?> therefore Parameters of methodes with Generics won't find a Validator to validate them.
> You will get an exception:
> Caused by: javax.validation.UnexpectedTypeException: No validator could be found for type java.util.Map. See: @NotEmpty at org.apache.bval.jsr303.extensions.ParameterAccess@1d2f117
> The parameter of the my method is Map<Object, Object>.
> I have attached a patch-file.
> I don't know i this is the best way to solve the problem or if there is allready a patch or i use the validation in a wrong way.
> Thank you.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira