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

[Backport 2.x] Call 'toArray()' with an empty array instead of a pre-sized array #16563

Merged

Conversation

andrross
Copy link
Member

@andrross andrross commented Nov 5, 2024

Backports 9fc3f40 from #5277 to 2.x

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…ensearch-project#5277)

Calls to `Collection.toArray()` is not consistent and in many places and use a
pre-sized array parameter. This change makes a consistent use of the
`toArray(new T[0])`. The empty array usage is considered faster, safer and
cleaner than the sized based array approach.

Signed-off-by: Rabi Panda <[email protected]>
Copy link
Contributor

github-actions bot commented Nov 5, 2024

❌ Gradle check result for d79340f: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Nov 5, 2024

❕ Gradle check result for d79340f: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 82.75862% with 20 lines in your changes missing coverage. Please review.

Project coverage is 71.77%. Comparing base (2fa8370) to head (d79340f).
Report is 1 commits behind head on 2.x.

Files with missing lines Patch % Lines
...ava/org/opensearch/action/get/MultiGetRequest.java 33.33% 0 Missing and 2 partials ⚠️
...search/client/indices/PutIndexTemplateRequest.java 0.00% 1 Missing ⚠️
...search/index/rankeval/TransportRankEvalAction.java 50.00% 1 Missing ⚠️
...n/indices/alias/TransportIndicesAliasesAction.java 50.00% 1 Missing ⚠️
...ion/admin/indices/segments/PitSegmentsRequest.java 0.00% 1 Missing ⚠️
...nsearch/action/admin/indices/stats/IndexStats.java 50.00% 1 Missing ⚠️
.../indices/template/put/PutIndexTemplateRequest.java 0.00% 1 Missing ⚠️
.../admin/indices/upgrade/get/IndexUpgradeStatus.java 0.00% 1 Missing ⚠️
...ices/upgrade/get/TransportUpgradeStatusAction.java 0.00% 1 Missing ⚠️
...min/indices/upgrade/get/UpgradeStatusResponse.java 0.00% 1 Missing ⚠️
... and 9 more
Additional details and impacted files
@@             Coverage Diff              @@
##                2.x   #16563      +/-   ##
============================================
- Coverage     71.95%   71.77%   -0.18%     
+ Complexity    65440    65385      -55     
============================================
  Files          5312     5312              
  Lines        305033   305024       -9     
  Branches      44443    44443              
============================================
- Hits         219475   218931     -544     
- Misses        67269    67881     +612     
+ Partials      18289    18212      -77     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@reta reta merged commit 6557176 into opensearch-project:2.x Nov 5, 2024
64 of 65 checks passed
@andrross andrross deleted the backport/backport-5277-to-2.x branch November 5, 2024 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants