The GitHub Actions job "Headers" on 
pekko.git/optimize-stage-actor-ref-lazy-dispatch has failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
bec6527f7504d2d53d89ab9e1cd69f18c5c4f740 / He-Pin <[email protected]>
fix: encapsulate VarHandle access and clean up LazyDispatch style

Motivation:
PR review feedback from pjfanning:
1. `apply` method used `asInstanceOf[AnyRef] eq null`, semicolons on
   one line, and early `return` — non-idiomatic Scala style.
2. VarHandle accessed directly via companion `stateHandle` field from
   call sites — should be encapsulated behind methods on LazyDispatch.

Modification:
- Add private `getState()/setState()/casState()` methods on LazyDispatch
  that encapsulate all VarHandle access. The typed local in `getState()`
  witnesses the Int-returning signature-polymorphic overload for Scala 3.
- Restructure `apply` to use `if/else` instead of early `return`,
  `msg == null` instead of `msg.asInstanceOf[AnyRef] eq null`, and no
  semicolons.
- Replace all `val u = LazyDispatch.stateHandle; u.xxx(this, ...)`
  patterns in `drain()` with the new accessor methods.

Result:
VarHandle is retained (saves ~16 bytes/instance vs AtomicInteger) but
fully encapsulated. Code style aligned with project conventions.
Compilation clean on Scala 2.13.

References:
Refs #3035 (pjfanning review comments).

Report URL: https://github.com/apache/pekko/actions/runs/27085878137

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to