8000 Fixing squid:S1854 - Dead stores should be removed. · MStart/reactivesocket-java@ed8ba7f · GitHub
[go: up one dir, main page]

Skip to content

Commit ed8ba7f

Browse files
author
Faisal Hameed
committed
Fixing squid:S1854 - Dead stores should be removed.
1 parent 7045212 commit ed8ba7f

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/main/java/io/reactivesocket/exceptions/Exceptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static Throwable from(Frame frame) {
3131
message = new String(byteBuffer.array(), UTF_8);
3232
}
3333

34-
Throwable ex = null;
34+
Throwable ex;
3535
switch (errorCode) {
3636
case APPLICATION_ERROR:
3737
ex = new ApplicationException(message);

src/main/java/io/reactivesocket/internal/Requester.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ public void onNext(Frame frame) {
947947
}
948948

949949
public void onError(Throwable t) {
950-
Collection<UnicastSubject<Frame>> subjects = null;
950+
Collection<UnicastSubject<Frame>> subjects;
951951
synchronized (Requester.this) {
952952
subjects = streamInputMap.values();
953953
}
@@ -958,7 +958,7 @@ public void onError(Throwable t) {
958958
}
959959

960960
public void onComplete() {
961-
Collection<UnicastSubject<Frame>> subjects = null;
961+
Collection<UnicastSubject<Frame>> subjects;
962962
synchronized (Requester.this) {
963963
subjects = streamInputMap.values();
964964
}

src/main/java/io/reactivesocket/internal/Responder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public void onNext(Frame requestFrame) {
253253
responsePublisher = handleMetadataPush(
254254
requestFrame, requestHandler);
255255
} else if (requestFrame.getType() == FrameType.CANCEL) {
256-
Subscription s = null;
256+
Subscription s;
257257
synchronized (Responder.this) {
258258
s = cancellationSubscriptions.get(requestFrame.getStreamId());
259259
}
@@ -262,7 +262,7 @@ public void onNext(Frame requestFrame) {
262262
}
263263
return;
264264
} else if (requestFrame.getType() == FrameType.REQUEST_N) {
265-
SubscriptionArbiter inFlightSubscription = null;
265+
SubscriptionArbiter inFlightSubscription;
266266
synchronized (Responder.this) {
267267
inFlightSubscription = inFlight.get(requestFrame.getStreamId());
268268
}
@@ -693,7 +693,7 @@ private Publisher<Frame> handleRequestChannel(Frame requestFrame,
693693
Int2ObjectHashMap<Subscription> cancellationSubscriptions,
694694
Int2ObjectHashMap<SubscriptionArbiter> inFlight) {
695695

696-
UnicastSubject<Payload> channelSubject = null;
696+
UnicastSubject<Payload> channelSubject;
697697
synchronized(Responder.this) {
698698
channelSubject = channels.get(requestFrame.getStreamId());
699699
}
@@ -869,7 +869,7 @@ public void addTransportRequest(long n) {
869869
}
870870

871871
private void tryRequest() {
872-
long toRequest = 0;
872+
long toRequest;
873873
synchronized(this) {
874874
if(applicationProducer == null) {
875875
return;

src/main/java/io/reactivesocket/internal/rx/CompositeDisposable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void clear() {
4747

4848
@Override
4949
public void dispose() {
50-
Disposable[] cs = null;
50+
Disposable[] cs;
5151
synchronized (this) {
5252
disposed = true;
5353
cs = resources.toArray(new Disposable[] {});

src/main/java/io/reactivesocket/lease/FairLeaseGovernor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public synchronized void unregister(Responder responder) {
6868

6969
@Override
7070
public synchronized boolean accept(Responder responder, Frame frame) {
71-
boolean valid = false;
71+
boolean valid;
7272
final Integer remainingTickets = responders.get(responder);
7373
return remainingTickets == null || remainingTickets > 0;
7474
}

0 commit comments

Comments
 (0)
0