Skip to content

Commit e72332c

Browse files
committed
Add missing Generic param to Answers
1 parent 9d1b33c commit e72332c

6 files changed

Lines changed: 8 additions & 8 deletions

File tree

core/src/test/java/io/grpc/internal/MessageDeframerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ public void compressed() {
190190

191191
@Test
192192
public void deliverIsReentrantSafe() {
193-
doAnswer(new Answer() {
193+
doAnswer(new Answer<Void>() {
194194
@Override
195-
public Object answer(InvocationOnMock invocation) throws Throwable {
195+
public Void answer(InvocationOnMock invocation) throws Throwable {
196196
deframer.request(1);
197197
return null;
198198
}

netty/src/main/java/io/grpc/netty/RequestMessagesCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
class RequestMessagesCommand {
4040

4141
private final int numMessages;
42-
private final AbstractStream stream;
42+
private final AbstractStream<Integer> stream;
4343

4444
public RequestMessagesCommand(AbstractStream<Integer> stream, int numMessages) {
4545
this.numMessages = numMessages;

netty/src/test/java/io/grpc/netty/NettyClientHandlerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public void setUp() throws Exception {
148148
handler.startWriteQueue(channel);
149149
writeQueue = handler.getWriteQueue();
150150
// Delegate writes on the channel to the handler
151-
doAnswer(new Answer() {
151+
doAnswer(new Answer<Object>() {
152152
@Override
153153
public Object answer(InvocationOnMock invocation) throws Throwable {
154154
handler.write(ctx, invocation.getArguments()[0],

netty/src/test/java/io/grpc/netty/NettyClientStreamTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ public void setHttp2StreamShouldNotifyReady() {
333333
@Override
334334
protected NettyClientStream createStream() {
335335
when(handler.getWriteQueue()).thenReturn(writeQueue);
336-
doAnswer(new Answer() {
336+
doAnswer(new Answer<Object>() {
337337
@Override
338338
public Object answer(InvocationOnMock invocation) throws Throwable {
339339
if (future.isDone()) {

netty/src/test/java/io/grpc/netty/NettyServerHandlerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,14 @@ public void setUp() throws Exception {
135135
mockContext();
136136
mockFuture(true);
137137
// Delegate writes on the channel to the handler
138-
doAnswer(new Answer() {
138+
doAnswer(new Answer<Object>() {
139139
@Override
140140
public Object answer(InvocationOnMock invocation) throws Throwable {
141141
handler.write(ctx, invocation.getArguments()[0], promise);
142142
return future;
143143
}
144144
}).when(channel).write(any());
145-
doAnswer(new Answer() {
145+
doAnswer(new Answer<Object>() {
146146
@Override
147147
public Object answer(InvocationOnMock invocation) throws Throwable {
148148
handler.write(ctx, invocation.getArguments()[0],

netty/src/test/java/io/grpc/netty/NettyServerStreamTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public void cancelStreamShouldSucceed() {
244244
@Override
245245
protected NettyServerStream createStream() {
246246
when(handler.getWriteQueue()).thenReturn(writeQueue);
247-
doAnswer(new Answer() {
247+
doAnswer(new Answer<Object>() {
248248
@Override
249249
public Object answer(InvocationOnMock invocation) throws Throwable {
250250
if (future.isDone()) {

0 commit comments

Comments
 (0)