NPE when validating an object tree whith a class whose parent has defined property constraints

Description

Today I switched from HV 5.0.1 to 5.2.1 and happily enough to know that it was claimed to be a drop-in replacement for all 5.x versions, I started my code and WOW! My code throws NPE at our initial system validations with this stack trace:

Working a little bit on the issue, I could manage to reproduce it in a simple unit test that I've attached. I repeat it here for the sake of description.

Suppose that we have these simple classes:

If I want to validate an instance of MainBean which has an instance of BottomBean as its child, the mentioned exception occurs!

I searched the issue database to find that has already reported this same issue, but since there has been no test cases, the issue was resolved with "Cannot Reproduce". As I could not reopen the issue, I decided to report it here since I think it is a downside to a very reliable library.

Environment

Java: 8u60 HV: 5.2.1.Final TestNG 6.9.5

Attachments

2

Activity

Show:

Hamid Nazari September 22, 2015 at 2:09 PM

Thanks for the follow up. I'll be watching the progress on this.

Hardy Ferentschik September 22, 2015 at 1:37 PM

Actually the issue I am referring to is and looking at BeanMetaDataImpl#addMetaDataToBuilder and reverting the changes made for in this methods make this test pass again. We need to investigate the different requirements for and and look for a solution for both.

Hardy Ferentschik September 22, 2015 at 1:31 PM

Hi , thanks for the feedback and bug report. I added the following to ValidatorTest and I can confirm your NullPointerException:

The problem seems to be related with the visibility of getProperty. If you make this method public all works as expected. I know we made changes around method validation which related to method visibility. This might be related. We need to have a closer look...

Hamid Nazari September 22, 2015 at 11:18 AM

I've just made a small modification to the test case and re-uploaded.

Fixed

Details

Assignee

Reporter

Bug Testcase Reminder (view)

Bug reports should generally be accompanied by a test case!

Bug Testcase Reminder (edit)

Bug reports should generally be accompanied by a test case!

Participants

Gunnar Morling
Hamid Nazari
Hardy Ferentschik

Pull Request

Components

Fix versions

Affects versions

Priority

Created September 22, 2015 at 11:03 AM
Updated September 29, 2015 at 8:38 AM
Resolved September 28, 2015 at 12:24 PM