Skip to content
This repository was archived by the owner on Sep 24, 2019. It is now read-only.

Commit ff87b7a

Browse files
author
Christoph Büscher
authored
Remove unnecessary warning supressions (elastic#32250)
1 parent 4b3284f commit ff87b7a

File tree

87 files changed

+64
-139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+64
-139
lines changed

client/transport/src/main/java/org/elasticsearch/transport/client/PreBuiltTransportClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import io.netty.util.ThreadDeathWatcher;
2323
import io.netty.util.concurrent.GlobalEventExecutor;
24+
2425
import org.elasticsearch.client.transport.TransportClient;
2526
import org.elasticsearch.common.SuppressForbidden;
2627
import org.elasticsearch.common.network.NetworkModule;

libs/nio/src/test/java/org/elasticsearch/nio/ChannelFactoryTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ private static class TestChannelFactory extends ChannelFactory<NioServerSocketCh
137137
super(rawChannelFactory);
138138
}
139139

140-
@SuppressWarnings("unchecked")
141140
@Override
142141
public NioSocketChannel createChannel(NioSelector selector, SocketChannel channel) throws IOException {
143142
NioSocketChannel nioSocketChannel = new NioSocketChannel(channel);

libs/nio/src/test/java/org/elasticsearch/nio/EventHandlerTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ public void testHandleAcceptCallsChannelFactory() throws IOException {
120120
verify(channelFactory, times(2)).acceptNioChannel(same(serverContext), same(selectorSupplier));
121121
}
122122

123-
@SuppressWarnings("unchecked")
124123
public void testHandleAcceptCallsServerAcceptCallback() throws IOException {
125124
NioSocketChannel childChannel = new NioSocketChannel(mock(SocketChannel.class));
126125
SocketChannelContext childContext = mock(SocketChannelContext.class);

libs/nio/src/test/java/org/elasticsearch/nio/SocketChannelContextTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ public void testCloseClosesWriteProducer() throws IOException {
275275
}
276276
}
277277

278-
@SuppressWarnings("unchecked")
279278
public void testCloseClosesChannelBuffer() throws IOException {
280279
try (SocketChannel realChannel = SocketChannel.open()) {
281280
when(channel.getRawChannel()).thenReturn(realChannel);

modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/stats/MultiPassStats.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class MultiPassStats {
4343
this.fieldBKey = fieldBName;
4444
}
4545

46-
@SuppressWarnings("unchecked")
4746
void computeStats(final List<Double> fieldA, final List<Double> fieldB) {
4847
// set count
4948
count = fieldA.size();

modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/JsonProcessorTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ public void testFieldMissing() {
146146
assertThat(exception.getMessage(), equalTo("field [field] not present as part of path [field]"));
147147
}
148148

149-
@SuppressWarnings("unchecked")
150149
public void testAddToRoot() throws Exception {
151150
String processorTag = randomAlphaOfLength(3);
152151
String randomTargetField = randomAlphaOfLength(2);

modules/lang-painless/src/test/java/org/elasticsearch/painless/InitializerTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
public class InitializerTests extends ScriptTestCase {
2828

29-
@SuppressWarnings({"unchecked", "rawtypes"})
29+
@SuppressWarnings({"rawtypes"})
3030
public void testArrayInitializers() {
3131
int[] ints = (int[])exec("new int[] {}");
3232

@@ -59,7 +59,7 @@ public void testArrayInitializers() {
5959
assertEquals("aaaaaa", objects[3]);
6060
}
6161

62-
@SuppressWarnings({"unchecked", "rawtypes"})
62+
@SuppressWarnings({"rawtypes"})
6363
public void testListInitializers() {
6464
List list = (List)exec("[]");
6565

@@ -91,7 +91,7 @@ public void testListInitializers() {
9191
assertEquals("aaaaaa", list.get(3));
9292
}
9393

94-
@SuppressWarnings({"unchecked", "rawtypes"})
94+
@SuppressWarnings({"rawtypes"})
9595
public void testMapInitializers() {
9696
Map map = (Map)exec("[:]");
9797

modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryAction.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client
5757
}
5858

5959
@Override
60-
@SuppressWarnings("unchecked")
6160
protected UpdateByQueryRequest buildRequest(RestRequest request) throws IOException {
6261
/*
6362
* Passing the search request through UpdateByQueryRequest first allows

modules/transport-netty4/src/test/java/org/elasticsearch/transport/netty4/SimpleNetty4TransportTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ protected MockTransportService build(Settings settings, Version version, Cluster
9090
@Override
9191
protected void closeConnectionChannel(Transport transport, Transport.Connection connection) throws IOException {
9292
final Netty4Transport t = (Netty4Transport) transport;
93-
@SuppressWarnings("unchecked")
9493
final TcpTransport.NodeChannels channels = (TcpTransport.NodeChannels) connection;
9594
CloseableChannel.closeChannels(channels.getChannels().subList(0, randomIntBetween(1, channels.getChannels().size())), true);
9695
}

plugins/transport-nio/src/test/java/org/elasticsearch/http/nio/HttpReadWriteHandlerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import io.netty.handler.codec.http.HttpResponseStatus;
3333
import io.netty.handler.codec.http.HttpUtil;
3434
import io.netty.handler.codec.http.HttpVersion;
35+
3536
import org.elasticsearch.common.bytes.BytesArray;
3637
import org.elasticsearch.common.settings.Settings;
3738
import org.elasticsearch.common.unit.ByteSizeValue;
@@ -89,7 +90,6 @@ public class HttpReadWriteHandlerTests extends ESTestCase {
8990
private final ResponseDecoder responseDecoder = new ResponseDecoder();
9091

9192
@Before
92-
@SuppressWarnings("unchecked")
9393
public void setMocks() {
9494
transport = mock(NioHttpServerTransport.class);
9595
Settings settings = Settings.EMPTY;

0 commit comments

Comments
 (0)