Skip to content

Commit f3650b4

Browse files
authored
Remove -Xlint exclusions in all plugins. (#40721)
The xlint exclusions of the following plugins were removed: * ingest-attachment. * mapper-size. * transport-nio. Removing the -try exclusion required some work, because the NettyAdaptor implements AutoCloseable and NettyAdaptor#close() method could throw an InterruptedException (ChannelFuture#await() and a generic Exception is re-thrown, which maybe an ChannelFuture). The easiest way around this to me seemed that NettyAdaptor should not implement AutoCloseable, because it is not directly used in a try-with-resources statement. Relates to #40366
1 parent 153c1eb commit f3650b4

File tree

5 files changed

+2
-13
lines changed

5 files changed

+2
-13
lines changed

plugins/ingest-attachment/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,6 @@ dependencies {
6868
compile "org.apache.james:apache-mime4j-dom:${versions.mime4j}"
6969
}
7070

71-
// TODO: stop using LanguageIdentifier...
72-
compileJava.options.compilerArgs << "-Xlint:-deprecation"
73-
74-
7571
dependencyLicenses {
7672
mapping from: /apache-mime4j-.*/, to: 'apache-mime4j'
7773
}

plugins/ingest-attachment/src/main/java/org/elasticsearch/ingest/attachment/AttachmentProcessor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public IngestDocument execute(IngestDocument ingestDocument) {
112112
}
113113

114114
if (properties.contains(Property.LANGUAGE) && Strings.hasLength(parsedContent)) {
115+
// TODO: stop using LanguageIdentifier...
115116
LanguageIdentifier identifier = new LanguageIdentifier(parsedContent);
116117
String language = identifier.getLanguage();
117118
additionalFields.put(Property.LANGUAGE.toLowerCase(), language);

plugins/mapper-size/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,3 @@ esplugin {
2121
description 'The Mapper Size plugin allows document to record their uncompressed size at index time.'
2222
classname 'org.elasticsearch.plugin.mapper.MapperSizePlugin'
2323
}
24-
25-
// TODO: migrate to points
26-
compileJava.options.compilerArgs << "-Xlint:-deprecation"
27-
compileTestJava.options.compilerArgs << "-Xlint:-deprecation"

plugins/transport-nio/build.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ esplugin {
2424
hasClientJar = true
2525
}
2626

27-
compileJava.options.compilerArgs << "-Xlint:-try"
28-
compileTestJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked"
29-
3027
dependencies {
3128
compile "org.elasticsearch:elasticsearch-nio:${version}"
3229

plugins/transport-nio/src/main/java/org/elasticsearch/http/nio/NettyAdaptor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import java.util.LinkedList;
3737
import java.util.function.BiConsumer;
3838

39-
public class NettyAdaptor implements AutoCloseable {
39+
class NettyAdaptor {
4040

4141
private final EmbeddedChannel nettyChannel;
4242
private final LinkedList<FlushOperation> flushOperations = new LinkedList<>();
@@ -64,7 +64,6 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
6464
nettyChannel.pipeline().addLast(handlers);
6565
}
6666

67-
@Override
6867
public void close() throws Exception {
6968
assert flushOperations.isEmpty() : "Should close outbound operations before calling close";
7069

0 commit comments

Comments
 (0)