You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "He-Pin (via GitHub)" <gi...@apache.org> on 2026/06/26 05:11:53 UTC
[PR] refactor: apply misc Java 11-17 improvements [pekko]
He-Pin opened a new pull request, #3193:
URL: https://github.com/apache/pekko/pull/3193
## Summary
- `String.isBlank()` replacing `trim().isEmpty()`
- `Collection.toArray(IntFunction)` replacing `toArray(new X[0])`
- `Map.forEach` replacing entrySet iteration loops
- Text blocks `"""..."""` replacing multi-line string concatenation
- Records replacing simple data holder classes
## Changes
### String.isBlank() (Java 11+)
- `ShardingEventSourcedEntityWithEnforcedRepliesCompileOnlyTest.java`
### Collection.toArray(IntFunction) (Java 11+)
- `GraphDslTest.java` — `toArray(new String[] {})` → `toArray(String[]::new)`
- `BidiFlowDocTest.java` — `toArray(new Message[0])` → `toArray(Message[]::new)`
### Map.forEach (Java 8+)
- `ReplicatedShoppingCartExample.java` — entrySet loop → `cart.forEach((k, v) -> ...)`
- `DeviceGroupQuery.java` — entrySet loop → `deviceIdToActor.forEach((k, v) -> ...)`
### Text blocks (Java 15+)
- `SubstreamDocTest.java` — 3-line string concat → text block
- `TestConfigExample.java` — config string concatenations → text blocks
### Records (Java 16+)
- `ImmutableMessage.java` → `record ImmutableMessage(int sequenceNumber, List<String> values)`
- `Messages.java` inner class → record
- `Message.Person` → `record Person(String first, String last)`
- `Bid.java` → `record Bid(UUID bidder, Instant bidTime, int bidPrice, int maximumBid)`
- Updated callers in `AuctionEntity.java` and `AuctionState.java` (getter names adjusted)
## Notes
- All changes in test/doc/example code only, no production API modifications
- `javafmtAll` verified — no formatting changes needed
--
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: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] refactor: apply misc Java 11-17 improvements [pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin merged PR #3193:
URL: https://github.com/apache/pekko/pull/3193
--
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: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org