Skip to content

Conversation

@gaobinlong
Copy link
Contributor

@gaobinlong gaobinlong commented Oct 22, 2025

Description

Use the modern instanceof pattern variables instead of explicit type conversions in the package org.opensearch.search, this can improve the code readability and reduce potential ClassCastException risks.

Most code are generated by LLM, and I checked them manually and reverted the unnecessary and wrong changes.

Related Issues

No issue, just mentioned this in a previous PR.

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.

…org.opensearch.search package

Signed-off-by: Binlong Gao <[email protected]>
Signed-off-by: Binlong Gao <[email protected]>
Signed-off-by: Binlong Gao <[email protected]>
Copy link
Member

@sandeshkr419 sandeshkr419 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Thanks for picking this up!
I have been procrastinating to do this myself.

@github-actions
Copy link
Contributor

❌ Gradle check result for 0c92e9f: 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?

@gaobinlong
Copy link
Contributor Author

❌ Gradle check result for 0c92e9f: 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?

Known issue: #15821

@github-actions
Copy link
Contributor

✅ Gradle check result for 0c92e9f: SUCCESS

@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

❌ Patch coverage is 50.74627% with 99 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.12%. Comparing base (f1a1e9f) to head (1b9cf48).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
.../search/aggregations/BucketCollectorProcessor.java 30.76% 17 Missing and 10 partials ⚠️
...h/search/query/rewriters/TermsMergingRewriter.java 50.00% 2 Missing and 5 partials ⚠️
...search/suggest/phrase/PhraseSuggestionBuilder.java 12.50% 5 Missing and 2 partials ⚠️
...ch/fetch/subphase/highlight/CustomQueryScorer.java 0.00% 3 Missing and 3 partials ⚠️
...a/org/opensearch/search/sort/FieldSortBuilder.java 33.33% 2 Missing and 4 partials ⚠️
...arch/search/pipeline/ProcessorExecutionDetail.java 44.44% 2 Missing and 3 partials ⚠️
...n/java/org/opensearch/search/SearchSortValues.java 33.33% 2 Missing and 2 partials ⚠️
...rch/query/rewriters/BooleanFlatteningRewriter.java 55.55% 0 Missing and 4 partials ⚠️
...earch/query/rewriters/MatchAllRemovalRewriter.java 60.00% 0 Missing and 4 partials ⚠️
...earch/aggregations/PipelineAggregationBuilder.java 25.00% 1 Missing and 2 partials ⚠️
... and 21 more
Additional details and impacted files
@@            Coverage Diff            @@
##               main   #19714   +/-   ##
=========================================
  Coverage     73.11%   73.12%           
+ Complexity    70911    70899   -12     
=========================================
  Files          5735     5735           
  Lines        324655   324609   -46     
  Branches      46962    46962           
=========================================
- Hits         237376   237373    -3     
+ Misses        68173    68092   -81     
- Partials      19106    19144   +38     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

❌ Gradle check result for e277f97: 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?

@github-actions
Copy link
Contributor

❌ Gradle check result for e277f97: 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?

@github-actions
Copy link
Contributor

❌ Gradle check result for e277f97: 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?

@sandeshkr419
Copy link
Member

@gaobinlong Can you please rebase with main once - bwc should succeed then.

@github-actions
Copy link
Contributor

❌ Gradle check result for 1b9cf48: 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?

@github-actions
Copy link
Contributor

✅ Gradle check result for 1b9cf48: SUCCESS

@sandeshkr419 sandeshkr419 merged commit a250c35 into opensearch-project:main Oct 24, 2025
33 of 36 checks passed
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