-
Notifications
You must be signed in to change notification settings - Fork 2k
Make use of Java 17 pattern matching switch statements #17909
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
base: main
Are you sure you want to change the base?
Conversation
❌ Gradle check result for 38eeb9d: 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? |
❕ Gradle check result for f3e2454: 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17909 +/- ##
=========================================
Coverage 72.43% 72.44%
- Complexity 66789 66809 +20
=========================================
Files 5449 5452 +3
Lines 309085 309181 +96
Branches 44979 44963 -16
=========================================
+ Hits 223899 223998 +99
+ Misses 66906 66843 -63
- Partials 18280 18340 +60 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
❌ Gradle check result for f2ae0fa: 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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for raising a PR @JaySabva! There are other classes as well. For ex:
- https://github.com/opensearch-project/OpenSearch/blob/main/plugins/repository-s3/src/internalClusterTest/java/org/opensearch/repositories/s3/S3BlobStoreRepositoryTests.java#L357-L368
- https://github.com/opensearch-project/OpenSearch/blob/main/buildSrc/src/main/java/org/opensearch/gradle/util/Util.java#L135-L145
To name a few.
Also, DCO check is failing. Can you sign your commit withgit commit -s --amend
and push again? To sign the commits you need to include-s
flag
return true; | ||
} | ||
case OpenSearchToParentBlockJoinQuery ostpbjq -> ostpbjq.getPath() != null; | ||
case null -> true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this map to default case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that will raise null pointer exception I tried that in my scratch file.
} else { | ||
return true; | ||
} | ||
case null -> true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too
I thought only instance of if else. Sure I will make changes. |
…witch statements Signed-off-by: Jay Sabva <[email protected]>
…witch statements Signed-off-by: Jay Sabva <[email protected]>
…witch statements Signed-off-by: Jay Sabva <[email protected]>
…witch statements Signed-off-by: Jay Sabva <[email protected]>
…witch statements Signed-off-by: Jay Sabva <[email protected]>
…witch statements Signed-off-by: Jay Sabva <[email protected]>
❌ Gradle check result for 5f4340f: 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? |
Description
Changed if-else instaceof check to JAVA 17 pattern matching switch
Related Issues
Resolves #17874
Check List
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.