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

Typed parameters in Java index API #10825

Closed
magnhaug opened this issue Apr 27, 2015 · 2 comments · Fixed by #11382
Closed

Typed parameters in Java index API #10825

magnhaug opened this issue Apr 27, 2015 · 2 comments · Fixed by #11382
Assignees
Labels

Comments

@magnhaug
Copy link

I believe the method signature for IndexRequestBuilder.setSource(Map<String, Object> source) should be changed to IndexRequestBuilder.setSource(Map<String, ?> source).
Since the method is overloaded, a call to setSource with a Map<String, String> as parameters will invoke the method IndexRequestBuilder.setSource(Object... source), to great confusion.

The same goes for CreateIndexRequestBuilder.setSettings(Map<String, Object> source) in the indices admin client, and a few others.

@clintongormley
Copy link

@javanna could you take a look please?

@javanna
Copy link
Member

javanna commented May 8, 2015

I think this makes sense, will mark as adoptme.

@javanna javanna added help wanted adoptme good first issue low hanging fruit labels May 8, 2015
@javanna javanna removed their assignment May 8, 2015
@jpountz jpountz removed the help wanted adoptme label May 22, 2015
cbuescher added a commit to cbuescher/elasticsearch that referenced this issue May 27, 2015
…lder

IndexRequestBuilder#setSource as well as CreateIndexRequestBuilder#setSettings and
CreateIndexRequestBuilder#setSouce() will not work with Map<String, String> argument
although the API looks like it should. This PR fixes the problem introducing correct
wildcard parameters and adds tests.

Closes elastic#10825
cbuescher added a commit to cbuescher/elasticsearch that referenced this issue May 29, 2015
…lder

IndexRequestBuilder#setSource as well as CreateIndexRequestBuilder#setSettings and
CreateIndexRequestBuilder#setSouce() will not work with Map<String, String> argument
although the API looks like it should. This PR fixes the problem introducing correct
wildcard parameters and adds tests.

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

Successfully merging a pull request may close this issue.

5 participants