bval-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@gmail.com>
Subject Re: Validating bean implementing Cloneable
Date Wed, 30 Apr 2014 22:13:44 GMT
I see now; I agree with your assessment of the issue. If you could open a
JIRA issue that'd be great. A failing test case would be better, and a
patch would be better still. :)

Thanks again,
Matt


On Wed, Apr 30, 2014 at 4:32 PM, Michael Blyakher <
michael.blyakher@gmail.com> wrote:

> Sure, pasted below:
>
> Exception in thread "main" javax.validation.ValidationException: error
> during validation of test.CloneableBean@363fbcdd
>     at
> org.apache.bval.jsr.ClassValidator.unrecoverableValidationError(ClassValidator.java:604)
>     at org.apache.bval.jsr.ClassValidator.validate(ClassValidator.java:144)
>     at test.Runner.main(Runner.java:16)
> Caused by: java.lang.NullPointerException
>     at
> org.apache.bval.jsr.ClassValidator.validateBeanNet(ClassValidator.java:409)
>     at
> org.apache.bval.jsr.ClassValidator.validateBeanWithGroups(ClassValidator.java:154)
>     at org.apache.bval.jsr.ClassValidator.validate(ClassValidator.java:142)
>     ... 1 more
>
> And here is the bean that caused it when being validated:
>
> public class CloneableBean implements Cloneable {
>
>     public CloneableBean() {
>         super();
>     }
> }
>
>
> Thanks,
> Mike
>
>
> On Wed, Apr 30, 2014 at 4:06 PM, Matt Benson <gudnabrsam@gmail.com> wrote:
>
>> Hi Michael,
>>   Do you have a stack trace for the NPE?
>>
>> Thanks,
>> Matt
>>
>>
>> On Wed, Apr 30, 2014 at 10:02 AM, Michael Blyakher <
>> michael.blyakher@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Working off of the 1.1.0-alpha branch, I have a bean that implements the
>>> Cloneable interface. When validating the bean, I get a
>>> NullPointerException. The issue seems to be that
>>> JsrMetaBeanFactory#buildMetaBean won't process the class if it is
>>> Cloneable, yet ClassHelper#fillFullClassHierarchyAsList still populates it.
>>>
>>> Is that a known bug? If not, I can create a jira issue and upload my
>>> test case and even a patch to fix it if the answer is that
>>> ClassHelper#fillFullClassHierarchyAsList needs to ignore Cloneable as well.
>>>
>>> Thoughts?
>>>
>>> Thanks,
>>> Mike
>>>
>>
>>
>

Mime
View raw message