You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@bval.apache.org by Michael Blyakher <mi...@gmail.com> on 2014/04/30 17:02:32 UTC
Validating bean implementing Cloneable
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
Re: Validating bean implementing Cloneable
Posted by Matt Benson <gu...@gmail.com>.
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 <gu...@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
>>>
>>
>>
>
Re: Validating bean implementing Cloneable
Posted by Michael Blyakher <mi...@gmail.com>.
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 <gu...@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
>>
>
>
Re: Validating bean implementing Cloneable
Posted by Matt Benson <gu...@gmail.com>.
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
>