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/07/25 11:30:24 UTC
[PR] Replace scala.Tuple2 with pekko.japi.Pair in FSMTransitionHandlerBuilder [pekko]
He-Pin opened a new pull request, #3378:
URL: https://github.com/apache/pekko/pull/3378
### Motivation
Java users see `scala.Tuple2` in their IDE when using `FSMTransitionHandlerBuilder`, which violates the principle of avoiding Scala data structures in Java APIs (#2086).
### Modification
- Replace `scala.Tuple2` with `pekko.japi.Pair` in `FSMTransitionHandlerBuilder`
- Update `AbstractFSM` and `PersistentFSMBase` to use a proper adapter instead of an unsafe `.asInstanceOf[TransitionHandler]` cast
- Add MiMa filters for the binary incompatibility
### Result
Java FSM API no longer exposes `scala.Tuple2`; uses the established `pekko.japi.Pair` type instead. The adapter is also type-safe (no more unchecked cast).
### Tests
- `sbt "actor-tests / Test / testOnly org.apache.pekko.actor.AbstractFSMActorTest"` PASSED
- `sbt "docs / Test / testOnly jdocs.actor.fsm.*"` PASSED
- `sbt "persistence / Test / testOnly org.apache.pekko.persistence.fsm.InmemPersistentFSMSpec"` PASSED
- `sbt "actor / mimaReportBinaryIssues"` PASSED
### References
Refs #2086
--
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] Replace scala.Tuple2 with pekko.japi.Pair in FSMTransitionHandlerBuilder [pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #3378:
URL: https://github.com/apache/pekko/pull/3378#discussion_r3650282883
##########
actor/src/main/mima-filters/2.0.x.backwards.excludes/replace-tuple2-with-pair.excludes:
##########
@@ -0,0 +1,5 @@
+# Replace scala.Tuple2 with pekko.japi.Pair in FSMTransitionHandlerBuilder
+# https://github.com/apache/pekko/issues/2086
+ProblemFilters.exclude[IncompatibleResultTypeProblem]("org.apache.pekko.japi.pf.FSMTransitionHandlerBuilder.build")
+ProblemFilters.exclude[IncompatibleSignatureProblem]("org.apache.pekko.japi.pf.FSMTransitionHandlerBuilder.build")
+ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.japi.pf.FSMTransitionHandlerBuilder.state")
Review Comment:
can you list this PR in the migration notes because it is a breaking change
https://github.com/apache/pekko/blob/main/docs/src/main/paradox/migration/migration-guide-1.x-2.x.md
--
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] Replace scala.Tuple2 with pekko.japi.Pair in FSMTransitionHandlerBuilder [pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #3378:
URL: https://github.com/apache/pekko/pull/3378#discussion_r3650280045
##########
actor/src/main/mima-filters/2.0.x.backwards.excludes/replace-tuple2-with-pair.excludes:
##########
@@ -0,0 +1,5 @@
+# Replace scala.Tuple2 with pekko.japi.Pair in FSMTransitionHandlerBuilder
Review Comment:
needs an Apache license header - not the one that mentions Akka, the standard one
--
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] Replace scala.Tuple2 with pekko.japi.Pair in FSMTransitionHandlerBuilder [pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin merged PR #3378:
URL: https://github.com/apache/pekko/pull/3378
--
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