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 failure in InnerHitBuilderTests around 'fields' option. #62344

Merged
merged 1 commit into from
Sep 14, 2020

Conversation

jtibshirani
Copy link
Contributor

Backport of #62341.

…62341)

The case InnerHitBuilderTests#testEqualsAndHashcode creates a copy of the object
by serializing + deserializing it, then applies a modification. If the 'fields'
list is empty, then deserializing it results in Collections.emptyList. Because
this is immutable, then modifying it can throw an UnsupportedOperationException.

This PR takes the same approach as for docvalue_fields, where we create a new
list instead of trying to add to an empty one.
@jtibshirani jtibshirani added >non-issue :Search/Search Search-related issues that do not fall into other categories backport labels Sep 14, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Search)

@elasticmachine elasticmachine added the Team:Search Meta label for search team label Sep 14, 2020
@jtibshirani jtibshirani merged commit f56ce4f into elastic:7.x Sep 14, 2020
@jtibshirani jtibshirani deleted the inner-hit-builder branch September 14, 2020 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport >non-issue :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants