Skip to content

Commit 06788a5

Browse files
committed
Merge pull request #78 from DevFactory/release/dead-stores-should-be-removed-fix-1
Code quality fix - Dead stores should be removed.
2 parents c066b66 + ed8ba7f commit 06788a5

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
@@ -34,7 +34,7 @@ public static Throwable from(Frame frame) {
3434
message = new String(byteBuffer.array(), UTF_8);
3535
}
3636

37-
Throwable ex = null;
37+
Throwable ex;
3838
switch (errorCode) {
3939
case APPLICATION_ERROR:
4040
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
@@ -257,7 +257,7 @@ public void onNext(Frame requestFrame) {
257257
responsePublisher = handleMetadataPush(
258258
requestFrame, requestHandler);
259259
} else if (requestFrame.getType() == FrameType.CANCEL) {
260-
Subscription s = null;
260+
Subscription s;
261261
synchronized (Responder.this) {
262262
s = cancellationSubscriptions.get(requestFrame.getStreamId());
263263
}
@@ -266,7 +266,7 @@ public void onNext(Frame requestFrame) {
266266
}
267267
return;
268268
} else if (requestFrame.getType() == FrameType.REQUEST_N) {
269-
SubscriptionArbiter inFlightSubscription = null;
269+
SubscriptionArbiter inFlightSubscription;
270270
synchronized (Responder.this) {
271271
inFlightSubscription = inFlight.get(requestFrame.getStreamId());
272272
}
@@ -697,7 +697,7 @@ private Publisher<Frame> handleRequestChannel(Frame requestFrame,
697697
Int2ObjectHashMap<Subscription> cancellationSubscriptions,
698698
Int2ObjectHashMap<SubscriptionArbiter> inFlight) {
699699

700-
UnicastSubject<Payload> channelSubject = null;
700+
UnicastSubject<Payload> channelSubject;
701701
synchronized(Responder.this) {
702702
channelSubject = channels.get(requestFrame.getStreamId());
703703
}
@@ -873,7 +873,7 @@ public void addTransportRequest(long n) {
873873
}
874874

875875
private void tryRequest() {
876-
long toRequest = 0;
876+
long toRequest;
877877
synchronized(this) {
878878
if(applicationProducer == null) {
879879
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)