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

Fix source excludes setting if no includes were provided #6632

Closed
jnaous opened this issue Jun 26, 2014 · 0 comments · Fixed by #6649
Closed

Fix source excludes setting if no includes were provided #6632

jnaous opened this issue Jun 26, 2014 · 0 comments · Fixed by #6649

Comments

@jnaous
Copy link
Contributor

jnaous commented Jun 26, 2014

Line 524 uses "include == null" to check if the exclude string is null.

I don't know why this had to be a one-liner, but I don't like using ternary operators, particularly twice (!) on the same line. Makes it harder to read and can lead to bugs like this.

Affects v1.2.1

Cheers!

@jnaous jnaous changed the title SearchRequestBuilder.setFetchSource(String, String) does not set excludes correctly SearchSourceBuilder.fetchSource(String, String) does not set excludes correctly Jun 26, 2014
@areek areek assigned rjernst and unassigned rjernst Jun 29, 2014
@spinscale spinscale self-assigned this Jun 30, 2014
spinscale added a commit to spinscale/elasticsearch that referenced this issue Jul 2, 2014
Due to a bogus if-check in SearchSourceBuilder.fetchSource(String include, String exclude)
the excludes only got set when the includes were not null. Fixed this and added some
basic tests.

Closes elastic#6632
spinscale added a commit that referenced this issue Jul 2, 2014
Due to a bogus if-check in SearchSourceBuilder.fetchSource(String include, String exclude)
the excludes only got set when the includes were not null. Fixed this and added some
basic tests.

Closes #6632
@spinscale spinscale changed the title SearchSourceBuilder.fetchSource(String, String) does not set excludes correctly JAVA API: Fix source excludes setting if no includes were provided Jul 2, 2014
spinscale added a commit that referenced this issue Jul 2, 2014
Due to a bogus if-check in SearchSourceBuilder.fetchSource(String include, String exclude)
the excludes only got set when the includes were not null. Fixed this and added some
basic tests.

Closes #6632
@clintongormley clintongormley changed the title JAVA API: Fix source excludes setting if no includes were provided Java API: Fix source excludes setting if no includes were provided Jul 9, 2014
@clintongormley clintongormley added the :Core/Infra/Transport API Transport client API label Jun 7, 2015
@clintongormley clintongormley changed the title Java API: Fix source excludes setting if no includes were provided Fix source excludes setting if no includes were provided Jun 7, 2015
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
Due to a bogus if-check in SearchSourceBuilder.fetchSource(String include, String exclude)
the excludes only got set when the includes were not null. Fixed this and added some
basic tests.

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

Successfully merging a pull request may close this issue.

4 participants