Skip to content
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

Potential NullPointerException in AbstractMappingContext [DATACMNS-695] #1162

Closed
spring-projects-issues opened this issue May 13, 2015 · 1 comment
Assignees

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented May 13, 2015

Elettra Petta opened DATACMNS-695 and commented

We found the reported issue upgrading Spring Data MongoDB library from 1.3.5.RELEASE to 1.5.5.RELEASE. The issue is triggered querying a nested generic field qualified with a custom class (not primitive). Following snippet shows the nested field we are trying to query:

public class External{
 ..
 private Optional<Internal> field = new Optional<Internal>();
 ..
}

The call to mongoOperations throws a NullPointerException originating from AbstractMappingContext. It is a Spring Data Commons class and we noticed that the issue starts from version 1.7.2.RELEASE of this library, just after commit 02046da


Affects: 1.8.5 (Dijkstra SR5)

Attachments:

Backported to: 1.10.1 (Fowler SR1), 1.9.3 (Evans SR3), 1.8.6 (Dijkstra SR6)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented May 13, 2015

Oliver Drotbohm commented

Good catch! getPersistentPropertyPath(…) used the raw type for intermediate path segments which dropped type information and thus caused the exception you saw. We're now using the TypeInformation backing the property and thus correctly resolve nested types.

Merged into all of the currently maintained branches. Note, that Dijkstra is really in string maintenance mode with its next and very last service release scheduled for mid July. We strongly recommend to upgrade to a newer release train

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.