-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IdentityMap.remember throws a NPE. #684
Comments
The identity map used the wrong map to look up the expected hash value when both a node and relationship with the same id have been loaded and a NPE happened when casting literal Null to long. This has been fixed by first selecting the correct hash. The error first appeared in the performance optimizations in #576, #577 and #579.
The identity map used the wrong map to look up the expected hash value when both a node and relationship with the same id have been loaded and a NPE happened when casting literal Null to long. This has been fixed by first selecting the correct hash. The error first appeared in the performance optimizations in #576, #577 and #579.
The identity map used the wrong map to look up the expected hash value when both a node and relationship with the same id have been loaded and a NPE happened when casting literal Null to long. This has been fixed by first selecting the correct hash. The error first appeared in the performance optimizations in #576, #577 and #579.
Thanks a lot for the report and detailed analysis, @johnfreier. I can confirm the bug and the point in time when it was introduced. This is fixed on 3.2.x and I also back ported the tests to 3.1.x. Expect a patch release early next week. |
This is fixed in 3.2.3, release is on it's way to central. Remember to that version upgrade in Spring Boot is done via Maven or Gradle property ( |
We are receiving a NPE in the IdentityMap.remember method, line 102.
neo4j-ogm/core/src/main/java/org/neo4j/ogm/context/IdentityMap.java
Lines 81 to 105 in 5f95e57
Because a node and a relationship could both have the same Id, it passes the initial guard condition, but when it attempts to retrieve the "expected" Id, the code looks in the wrong map, and throws an error.
Expected Behavior
I would expect the code to check if the Id exists before assigning the Id to a primitive.
Steps to Reproduce (for bugs)
To reproduce the issue, I wrote a simple unit test that is based on the current ogm unit test. IdentityMapTest.class(https://github.com/neo4j/neo4j-ogm/blob/master/neo4j-ogm-tests/neo4j-ogm-integration-tests/src/test/java/org/neo4j/ogm/context/IdentityMapTest.java)
Your Environment
The text was updated successfully, but these errors were encountered: