-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Different Queries, same hashCodes #4032
Comments
PR : #4831 |
Taking a step back, what problem are you trying to solve? Looking at the attached pull request, performance gets worse by an order of magnitude by introducing allocations ( |
@mp911de If the Thank you for your comment! |
Yes But specially on So how about using |
Are you running into a performance issue or a bug? What problem are you trying to solve? Same hashCodes are only a symptom. |
oh actually there's no big problem, but I found that hashCode can be same too easily on Query :) If you think this is not bug and only a symptom, we can just close issue ~! |
Closing as we do not indent to update our |
Consider two org.springframework.data.mongodb.core.query.Query instances almost identical except for one projection field which is
then the following test fails
Unit Test
Comments
The problem can be drilled down to the Field.hashCode()
which seems to fails due to the HashMap implementation itself as proved by the following test
however tests with other numbers than 0 or 1 works.
To conclude, the problem seem related to the use of 0 and 1 in the Field.criteria which then are translated according to the mongo projection syntax. Possible solution could be to replace in the Field class 0/1 used by include/exclude with enum INCLUDE/EXCLUDE values and consequently modify up to various get[Query|Field]Object().
Comments?
Regards,
Maurizio
The text was updated successfully, but these errors were encountered: