He-Pin opened a new pull request, #171:
URL: https://github.com/apache/pekko-samples/pull/171

   ### Motivation
   Java 17 introduced records, pattern matching for instanceof, and other 
features that make Java code more concise and readable. The 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, messages) to Java records 
across sample applications
   - Use pattern matching for instanceof to eliminate explicit casts
   - Update all field accesses from direct field access to record accessor 
methods
   - Remove redundant equals/hashCode/constructor boilerplate
   
   Files changed:
   - `pekko-sample-persistence-java/`: ShoppingCart
   - `pekko-sample-distributed-data-java/`: ShoppingCart, VotingService, 
ReplicatedCache
   - `pekko-sample-cluster-client-grpc-java/`: ClusterClient
   - `pekko-sample-persistence-dc-java/`: ThumbsUpCounter
   
   ### Result
   Example Java code is more concise and idiomatic for Java 17+, reducing 
boilerplate while maintaining the same behavior. Net reduction of ~350 lines of 
code across 6 files.
   
   ### Tests
   Not run - sample applications without automated test suite
   
   ### 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]

Reply via email to