- TimedRunnable(FiniteDuration timeout, RaftActor actor) {
- Preconditions.checkNotNull(timeout);
- Preconditions.checkNotNull(actor);
- cancelTimer = actor.getContext().system().scheduler().scheduleOnce(timeout, actor.self(), new Runnable() {
- @Override
- public void run() {
- cancel();
- }
- }, actor.getContext().system().dispatcher(), actor.self());
+ @SuppressFBWarnings(value = "MC_OVERRIDABLE_METHOD_CALL_IN_CONSTRUCTOR",
+ justification = "https://github.com/spotbugs/spotbugs/issues/1867")
+ TimedRunnable(final FiniteDuration timeout, final RaftActor actor) {
+ cancelTimer = requireNonNull(actor).getContext().system().scheduler()
+ .scheduleOnce(requireNonNull(timeout), actor.self(), (Runnable) this::cancel,
+ actor.getContext().system().dispatcher(), actor.self());