-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Use Java 14 switch expressions #82178
Conversation
07ed27d
to
4779bd2
Compare
JEP 361[https://openjdk.java.net/jeps/361] added support for switch expressions which can be much more terse and less error-prone than switch statements. Another useful feature of switch expressions is exhaustiveness: we can make sure that an enum switch expression covers all the cases at compile time.
4779bd2
to
4b50990
Compare
Pinging @elastic/es-core-infra (Team:Core/Infra) |
benchmarks/src/main/java/org/elasticsearch/benchmark/indices/common/RoundingBenchmark.java
Outdated
Show resolved
Hide resolved
...est-high-level/src/test/java/org/elasticsearch/client/ml/EvaluateDataFrameResponseTests.java
Outdated
Show resolved
Hide resolved
...igh-level/src/test/java/org/elasticsearch/client/security/KibanaEnrollmentResponseTests.java
Show resolved
Hide resolved
...-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformConfigTests.java
Show resolved
Hide resolved
...rc/test/java/org/elasticsearch/client/transform/transforms/pivot/AggregationConfigTests.java
Show resolved
Hide resolved
libs/x-content/src/test/java/org/elasticsearch/xcontent/XContentParserTests.java
Show resolved
Hide resolved
modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/EnhancedPainlessLexer.java
Outdated
Show resolved
Hide resolved
modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/EnhancedSuggestLexer.java
Outdated
Show resolved
Hide resolved
modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/GeoWKTParser.java
Show resolved
Hide resolved
...legacy-geo/src/main/java/org/elasticsearch/legacygeo/query/LegacyGeoShapeQueryProcessor.java
Outdated
Show resolved
Hide resolved
...repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureStorageService.java
Outdated
Show resolved
Hide resolved
# Conflicts: # x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/AllocateActionTests.java
…ommon/RoundingBenchmark.java Co-authored-by: Rory Hunter <pugnascotia@users.noreply.github.com>
See #82090 for the formatting problem - I've already filed an issue with Eclipse, but I suspect I'd have to fix it myself 🙈 |
...src/internalClusterTest/java/org/elasticsearch/search/suggest/CompletionSuggestSearchIT.java
Outdated
Show resolved
Hide resolved
.../org/elasticsearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java
Outdated
Show resolved
Hide resolved
…apshots/status/TransportSnapshotsStatusAction.java Co-authored-by: Rory Hunter <pugnascotia@users.noreply.github.com>
server/src/main/java/org/elasticsearch/cluster/routing/UnassignedInfo.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/Decision.java
Show resolved
Hide resolved
test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/util/QueryPageTests.java
Show resolved
Hide resolved
...k/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForIndexColorStepTests.java
Outdated
Show resolved
Hide resolved
.../src/test/java/org/elasticsearch/xpack/core/ilm/step/info/AllocationRoutedStepInfoTests.java
Outdated
Show resolved
Hide resolved
...c/test/java/org/elasticsearch/xpack/core/ml/action/EvaluateDataFrameActionResponseTests.java
Show resolved
Hide resolved
...gin/core/src/test/java/org/elasticsearch/xpack/core/security/support/StringMatcherTests.java
Outdated
Show resolved
Hide resolved
...ta-streams/src/test/java/org/elasticsearch/xpack/core/action/GetDataStreamsRequestTests.java
Outdated
Show resolved
Hide resolved
@elasticmachine update branch |
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.
LGTM.
Thanks, Rory! |
💔 Backport failed
You can use sqren/backport to manually backport by running |
JEP 361[https://openjdk.java.net/jeps/361] added support for switch expressions which can be much more terse and less error-prone than switch statements. Another useful feature of switch expressions is exhaustiveness: we can make sure that an enum switch expression covers all the cases at compile time. (cherry picked from commit 0699c93)
JEP 361[https://openjdk.java.net/jeps/361] added support for switch expressions which can be much more terse and less error-prone than switch statements. Another useful feature of switch expressions is exhaustiveness: we can make sure that an enum switch expression covers all the cases at compile time. (cherry picked from commit 0699c93) * Rollback switch expressions for the SQL plugin (#82349) It was updated to Java 8 compatibility in #82274 (cherry picked from commit 78509f4)
JEP 361 added support for switch expressions
which can be much more terse and less error-prone than switch statements.
Another useful feature of switch expressions is exhaustiveness: we can make
sure that an enum switch expression covers all the cases at compile time.