He-Pin opened a new pull request, #531: URL: https://github.com/apache/pekko-projection/pull/531
### Motivation Java 17 introduced records, pattern matching for instanceof, text blocks, and other features that make Java code more concise and readable. The test and example code contained many verbose data carrier classes and instanceof + explicit cast patterns that can be significantly simplified. ### Modification - Convert data carrier classes (commands, events, envelopes, results) to Java records across all test and example modules - Use pattern matching for instanceof to eliminate explicit casts - Use text blocks for multi-line SQL DDL strings - Update interface methods from `getXxx()` to `xxx()` style to match record accessor conventions - Update all field accesses from direct field access (`obj.field`) to record accessor method calls (`obj.field()`) Files changed: - `examples/`: ShoppingCart, ShoppingCartEvents, EventGeneratorApp, ItemPopularityProjectionHandler, JdbcProjectionDocExample, JdbcHibernateTest, KafkaDocExample - `integration-examples/`: CassandraProjectionDocExample, WordCountDocExample - `r2dbc/`: R2dbcProjectionDocExample - `cassandra-test/`: CassandraProjectionTest - `jdbc/`: JdbcProjectionTest ### Result Test and example Java code is more concise and idiomatic for Java 17+, reducing boilerplate while maintaining the same behavior. Net reduction of ~330 lines of code across 12 files. ### Tests - `sbt "examples / compile"` (to be verified by CI) - `sbt "integration-examples / compile"` (to be verified by CI) - `sbt "cassandra-test / Test / compile"` (to be verified by CI) - `sbt "jdbc / Test / compile"` (to be verified by CI) ### References None - code modernization -- 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]
