Java Docs: use instanceof with name binding (#2087)

* Java Docs: use instanceof with name binding

* remove changes in generated code

* Update docs/src/test/java/jdocs/ddata/protobuf/TwoPhaseSetSerializer2.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* merge issue

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
PJ Fanning 2025-08-25 13:45:13 +01:00 committed by GitHub
parent 18d7ff815a
commit 56470a4569
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 60 additions and 76 deletions

View file

@ -236,11 +236,9 @@ public class LambdaPersistenceDocTest {
}
void updateState(Object event) {
if (event instanceof MsgSent) {
final MsgSent evt = (MsgSent) event;
if (event instanceof MsgSent evt) {
deliver(destination, deliveryId -> new Msg(deliveryId, evt.s));
} else if (event instanceof MsgConfirmed) {
final MsgConfirmed evt = (MsgConfirmed) event;
} else if (event instanceof MsgConfirmed evt) {
confirmDelivery(evt.deliveryId);
}
}