imbajin opened a new pull request, #3406: URL: https://github.com/apache/hugegraph/pull/3406
## Purpose of the PR Source proposal: [org #338](https://github.com/hugegraph/hugegraph/pull/338), using the same source branch. Checked values are repeatedly cast after type checks, and simple value dispatch uses verbose switch statements. Use Java 17 pattern variables and switch expressions to simplify these paths across Server, PD, Store, Struct and cluster test setup while preserving their behavior. ## Main Changes - Bind validated values directly in type guards, including equivalent early-return and short-circuit paths. - Simplify value-returning switches while retaining defaults, exception messages, numeric boxing and encoding. - Keep stateful/fall-through switches, unsafe repeated evaluations and non-reifiable generic casts where a mechanical rewrite could change behavior. Commons retains its Java 11 compatibility target. Generated sources, public data formats and traversal algorithms are unchanged. The independent Union correctness fix is in [ASF #3405](https://github.com/apache/hugegraph/pull/3405); this PR does not include it or duplicate [ASF #3404](https://github.com/apache/hugegraph/pull/3404). ## Verifying these changes - [x] Existing tests: Struct compatibility/codecs, Server unit tests, PD common/core tests and Store core tests. - [x] Focused query, iterator, ordering and scan lifecycle regressions. - [x] Java 17 full clean compile, EditorConfig formatting and whitespace checks. - [x] Independent review of Server and distributed/shared modules found no blocking behavior changes. These checks do not replace live multi-node cluster acceptance. ## Documentation Status - [x] `Doc - No Need`: internal syntax refactoring with no API, configuration or behavior change. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
