Skip to content

DATAMONGO-1608 - Fixed potential NullPointerException for derived ignore case query methods #439

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

Closed
wants to merge 1 commit into from

Conversation

EdwardPrentice
Copy link
Contributor

@EdwardPrentice EdwardPrentice commented Feb 7, 2017

  • You have read the Spring Data contribution guidelines.
  • There is a ticket in the bug tracker for the project in our JIRA.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

@pivotal-issuemaster
Copy link

@EdwardPrentice Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@EdwardPrentice Thank you for signing the Contributor License Agreement!

@odrotbohm odrotbohm changed the title DATAMONGO-1608 Added a failing test - but fix is not complete yet DATAMONGO-1608 - Fixed potential NulPointerException for derived ignore case query methods Feb 8, 2017
@@ -15,6 +15,7 @@
*/
package org.springframework.data.mongodb.repository.query;

import static java.util.Objects.nonNull;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to preserve JDK 6 compatibility. Can we just exchange this against a simple null check?

@odrotbohm odrotbohm changed the title DATAMONGO-1608 - Fixed potential NulPointerException for derived ignore case query methods DATAMONGO-1608 - Fixed potential NullPointerException for derived ignore case query methods Feb 8, 2017
@EdwardPrentice EdwardPrentice force-pushed the master branch 2 times, most recently from 086d1e6 to 300ee43 Compare February 8, 2017 18:55
@EdwardPrentice
Copy link
Contributor Author

Made change to remove nonNull for JDK 6 compatibility. Tests don't all pass because I can't work out what should happen in the null case - all implementations I've come up with so far cause a different number of other tests to fail.

@EdwardPrentice
Copy link
Contributor Author

Done :) At least works, and passes all tests.

christophstrobl pushed a commit that referenced this pull request Feb 13, 2017
christophstrobl added a commit that referenced this pull request Feb 13, 2017
Throw an IllegalArgumentException when trying to create a query using 'null' as an argument for queries resulting in a $regex query operator.

Original Pull Request: #439
christophstrobl pushed a commit that referenced this pull request Feb 13, 2017
christophstrobl added a commit that referenced this pull request Feb 13, 2017
Throw an IllegalArgumentException when trying to create a query using 'null' as an argument for queries resulting in a $regex query operator.

Original Pull Request: #439
christophstrobl pushed a commit that referenced this pull request Feb 13, 2017
christophstrobl added a commit that referenced this pull request Feb 13, 2017
Throw an IllegalArgumentException when trying to create a query using 'null' as an argument for queries resulting in a $regex query operator.

Original Pull Request: #439
christophstrobl pushed a commit that referenced this pull request Feb 13, 2017
christophstrobl added a commit that referenced this pull request Feb 13, 2017
Throw an IllegalArgumentException when trying to create a query using 'null' as an argument for queries resulting in a $regex query operator.

Original Pull Request: #439
@christophstrobl
Copy link
Member

Thanks @EdwardPrentice! Applied to master and ported to SR branches.

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

Successfully merging this pull request may close these issues.

4 participants