NullPointerException in ValueContext.appendNode

Description

I have a small project in which I switched from standard values to java.util.Optional. Now any validation results in NullPointerExceptions in ValueContext.appendNode.
When redesigning the objects, I changed them from interfaces to abstract classes, but that should not inhibit validation. All fields are wrapped in Optional before returning, but are stored directly. Both field and method annotations lead to NullPointerExceptions. In fact, when changing one of the getters to return the field directly, with Optional wrapping, it still leads to NullPointerException.

I will try to track it down further. But I can't think of anything else I modified that could explain this.

Environment

None

Activity

Show:
Gunnar Morling
April 20, 2015, 1:46 PM

Closing this as "Cannot re-produce". Please feel free to re-open in case you have a test case demonstrating the issue based on the latest release. Thanks!

Hamid Nazari
September 22, 2015, 11:06 AM

I've created a new issue [#HV-1018] with an attached test suite to demonstrate the problem reported.
Please have a look at that.

Jin Kwon
July 22, 2016, 4:33 AM

I just have a same problem with 5.2.1.Final.
{{
@PreUpdate
@AssertFalse
boolean hasCyclicReference() {
for (T parent = getParent(); parent != null;
parent = parent.getParent()) {
if (parent.getId().equals(getId())) {
logger.log(Level.SEVERE,
"cyclic reference; current: {0}; ascendant: {1}",
new Object[]{this, parent});
return true;
}
}
return false;
}
}}
All I had to is make it package default.

Guillaume Smet
July 22, 2016, 9:03 AM

Hi Jin,

Are you sure it's not more similar to https://hibernate.atlassian.net/browse/HV-1071 ?

This has been fixed but not yet released.

If it's not the same issue, please open a new Jira issue with a proper test case. You can use this template: https://github.com/hibernate/hibernate-test-case-templates/tree/master/validator .

Jin Kwon
July 22, 2016, 10:32 AM

Hi Guillaume.
5.3.0.Alpha1 solved my problem.
I strongly believe it's 5.2.1.Final's issue.
Thanks

Assignee

Hardy Ferentschik

Reporter

Johannes Zick

Labels

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Affects versions

Priority

Major
Configure