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

MongodbSerializer unnecessarily calls getKeyForPath(…) #81

Closed
odrotbohm opened this issue Jan 12, 2012 · 1 comment
Closed

MongodbSerializer unnecessarily calls getKeyForPath(…) #81

odrotbohm opened this issue Jan 12, 2012 · 1 comment

Comments

@odrotbohm
Copy link

@odrotbohm odrotbohm commented Jan 12, 2012

As stated in a Spring Data forum post MongodbSerializer recursively calls visit(…) for any() path types passing an empty expression to the call. This results in getKeyForPath(…) being called with an empty expression which is actually not necessary as looking up a key for no expression hardly makes sense. Beyond that, potential subclasses have to deal with that case explicitly which complicates the implementation.

Long story short, the call to getKeyForPath(…) can be delayed into the else clause, avoiding that obsolete call.

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

Successfully merging a pull request may close this issue.

None yet
2 participants