8000 unchecked warnings (#393) · chakra-coder/rsocket-java@13035cd · GitHub
[go: up one dir, main page]

Skip to content

Commit 13035cd

Browse files
qweekyschimke
authored andcommitted
unchecked warnings (rsocket#393)
unchecked warnings issued by the compiler
1 parent 5db0275 commit 13035cd

File tree

3 files changed

+27
-26
lines changed

3 files changed

+27
-26
lines changed

rsocket-core/src/jmh/java/io/rsocket/RSocketPerf.java

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
package io.rsocket;
1818

19+
import io.rsocket.RSocketFactory.Start;
1920
import io.rsocket.perfutil.TestDuplexConnection;
20-
import io.rsocket.transport.ServerTransport;
2121
import io.rsocket.util.PayloadImpl;
2222
import java.nio.ByteBuffer;
2323
import java.nio.charset.StandardCharsets;
@@ -90,7 +90,7 @@ public static class Input {
9090
static final TestDuplexConnection serverConnection =
9191
new TestDuplexConnection(clientReceive, serverReceive);
9292

93-
static final Object server =
93+
static final Start<Closeable> server =
9494
RSocketFactory.receive()
9595
.acceptor(
9696
(setup, sendingSocket) -> {
@@ -135,27 +135,26 @@ public Mono<Void> onClose() {
135135
return Mono.just(rSocket);
136136
})
137137
.transport(
138-
(ServerTransport)
139-
acceptor -> {
140-
Closeable closeable =
141-
new Closeable() {
142-
MonoProcessor<Void> onClose = MonoProcessor.create();
143-
144-
@Override
145-
public Mono<Void> close() {
146-
return Mono.empty().doFinally(s -> onClose.onComplete()).then();
147-
}
148-
149-
@Override
150-
public Mono<Void> onClose() {
151-
return onClose;
152-
}
153-
};
154-
155-
acceptor.apply(serverConnection).subscribe();
156-
157-
return Mono.just(closeable);
158-
});
138+
acceptor -> {
139+
Closeable closeable =
140+
new Closeable() {
141+
MonoProcessor<Void> onClose = MonoProcessor.create();
142+
143+
@Override
144+
public Mono<Void> close() {
145+
return Mono.empty().doFinally(s -> onClose.onComplete()).then();
146+
}
147+
148+
@Override
149+
public Mono<Void> onClose() {
150+
return onClose;
151+
}
152+
};
153+
154+
acceptor.apply(serverConnection).subscribe();
155+
156+
return Mono.just(closeable);
157+
});
159158

160159
Subscriber blackHoleSubscriber;
161160

rsocket-core/src/test/java/io/rsocket/fragmentation/FragmentationDuplexConnectionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public void testReassembleFragmentFrame() {
121121
Frame.Request.from(1024, FrameType.REQUEST_RESPONSE, new PayloadImpl(data, metadata), 1);
122122
FrameFragmenter frameFragmenter = new FrameFragmenter(2);
123123
Flux<Frame> fragmentedFrames = frameFragmenter.fragment(frame);
124-
EmitterProcessor processor = EmitterProcessor.create(128);
124+
EmitterProcessor<Frame> processor = EmitterProcessor.create(128);
125125
DuplexConnection mockConnection = mock(DuplexConnection.class);
126126
when(mockConnection.receive()).then(answer -> processor);
127127

rsocket-core/src/test/java/io/rsocket/test/util/TestSubscriber.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ public static <T> Subscriber<T> create() {
1414
}
1515

1616
public static <T> Subscriber<T> create(long initialRequest) {
17-
Subscriber mock = mock(Subscriber.class);
17+
@SuppressWarnings("unchecked")
18+
Subscriber<T> mock = mock(Subscriber.class);
1819

1920
Mockito.doAnswer(
2021
invocation -> {
@@ -34,7 +35,8 @@ public static Payload anyPayload() {
3435
}
3536

3637
public static Subscriber<Payload> createCancelling() {
37-
Subscriber mock = mock(Subscriber.class);
38+
@SuppressWarnings("unchecked")
39+
Subscriber<Payload> mock = mock(Subscriber.class);
3840

3941
Mockito.doAnswer(
4042
invocation -> {

0 commit comments

Comments
 (0)
0