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

JPAQueryMixin.normalize isn't null safe anymore starting from 3.0.0 #379

Closed
gsmet opened this issue Mar 29, 2013 · 5 comments
Closed

JPAQueryMixin.normalize isn't null safe anymore starting from 3.0.0 #379

gsmet opened this issue Mar 29, 2013 · 5 comments
Milestone

Comments

@gsmet
Copy link

@gsmet gsmet commented Mar 29, 2013

Hi Timo,

Starting from 3.0.0, JPAQueryMixin.normalize isn't null safe anymore. Thus calling .where(null) leads to a NPE in 3.0.0 and 3.1.0. It worked fine in 2.9.0.

It was quite convenient to be able to build the Predicate in another method and able to return null when you have no resulting condition.

Something along the lines of:
query.where(buildMyPredicate1(some parameters), buildMyPredicate2(some parameters));
instead of:
Predicate p1 = buildMyPredicate1(some parameters);
if (p1 != null) {
query.where(p1);
}
Predicate p2 = buildMyPredicate2(some parameters);
if (p2 != null) {
query.where(p2);
}

We can work around it but I'm pretty sure we aren't the only people using this construct and it's a pretty nasty regression when it hits you.

Do you think you could make it null safe again?

I don't know if there's a planned maintenance release soon but it might be a good idea to include this fix in it, if so.

Thanks for your feedback.

timowest added a commit that referenced this issue Mar 29, 2013
@timowest
Copy link
Member

@timowest timowest commented Mar 29, 2013

Works again.

@gsmet
Copy link
Author

@gsmet gsmet commented Mar 29, 2013

Thanks for the very quick fix!

Do you plan to release something before April 12th? Just to know if I need to put a workaround in our app or if I can wait for the release.

Thanks for your feedback.

@timowest
Copy link
Member

@timowest timowest commented Mar 29, 2013

Yes, I believe the next release will be before April 12th.

@gsmet
Copy link
Author

@gsmet gsmet commented Mar 29, 2013

Nice, thanks.

@timowest
Copy link
Member

@timowest timowest commented Apr 16, 2013

Released in 3.1.1

@timowest timowest closed this Apr 16, 2013
@timowest timowest added this to the 3.1.1 milestone Apr 14, 2014
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