Copilot commented on code in PR #3149:
URL: https://github.com/apache/pekko/pull/3149#discussion_r3458373856
##########
actor/src/main/scala/org/apache/pekko/dispatch/AbstractDispatcher.scala:
##########
Review Comment:
This exception message refers to an \"actor class marker\", but the value is
a `shutdownSchedule` marker/state. Updating the message to reflect the actual
domain (e.g., \"Unexpected shutdown schedule marker\") would make diagnostics
less confusing.
##########
actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala:
##########
Review Comment:
The trailing `false // unreachable` is dead code that can hide control-flow
mistakes and may generate warnings depending on compiler settings. Prefer
`throw new IllegalStateException(\"unreachable\")` (or equivalent) if you need
a total expression, and apply the same change in the similar blocks in
`suspend()` and `becomeClosed()`.
##########
actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala:
##########
Review Comment:
`Thread.onSpinWait()` is only available starting with JDK 9. If this project
is compiled/run with Java 8 (or sets `--release 8` / `-source 1.8`), this will
fail to compile. Consider routing spin hints through a small compatibility
helper (e.g., a `SpinWait.onSpinWait()` that uses `Thread.onSpinWait()` when
available and otherwise no-ops) to preserve the supported Java baseline.
##########
actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala:
##########
Review Comment:
The `while ({ ... }) { ... }` construct with an early `return` inside the
condition block is hard to read and inconsistent with the clearer `while (true)
{ ... }` style used elsewhere in this diff (e.g.,
`resume/suspend/becomeClosed`). Consider rewriting this to a `while (true)`
loop with explicit branches/returns to improve readability without changing
semantics.
--
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]