Skip to content

Commit

Permalink
made Cancellable nullable and initialize it with null to fix sonar is…
Browse files Browse the repository at this point in the history
…sue;

Signed-off-by: Stefan Maute <stefan.maute@bosch.io>
  • Loading branch information
Stefan Maute committed Sep 22, 2022
1 parent 431478f commit a1bd8eb
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ final class QueryThingsPerRequestActor extends AbstractActor {

@Nullable private QueryThingsResponse queryThingsResponse;
@Nullable private List<ThingId> queryThingsResponseThingIds;
private Cancellable cancellableShutdownTask;
@Nullable private Cancellable cancellableShutdownTask;
private boolean inCoordinatedShutdown;
@Nullable private ActorRef coordinatedShutdownSender;

Expand All @@ -91,6 +91,7 @@ private QueryThingsPerRequestActor(final QueryThings queryThings,
this.originatingSender = originatingSender;
this.pubSubMediator = pubSubMediator;
queryThingsResponse = null;
cancellableShutdownTask = null;
inCoordinatedShutdown = false;
coordinatedShutdownSender = null;

Expand Down Expand Up @@ -126,7 +127,9 @@ public void preStart() {

@Override
public void postStop() {
cancellableShutdownTask.cancel();
if (cancellableShutdownTask != null) {
cancellableShutdownTask.cancel();
}
}

@Override
Expand Down

0 comments on commit a1bd8eb

Please sign in to comment.