Skip to content

Commit d8d9ab6

Browse files
committed
Remove -Xlint exclusions in the ingest-common module.
The generics in AbstractStringProcessor is not needed (IngestDocument#setFieldValue(...) accepts Object) and therefor it was removed. Otherwise the corresponding factory implementations would need typing too. Relates to #40366
1 parent 7e4d23d commit d8d9ab6

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

modules/ingest-common/build.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ dependencies {
2929
compile project(':libs:dissect')
3030
}
3131

32-
compileJava.options.compilerArgs << "-Xlint:-unchecked,-rawtypes"
33-
compileTestJava.options.compilerArgs << "-Xlint:-unchecked,-rawtypes"
34-
3532
integTestCluster {
3633
module project(':modules:lang-painless')
3734
}

modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/AbstractStringProcessor.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@
2929
/**
3030
* Base class for processors that manipulate source strings and require a single "fields" array config value, which
3131
* holds a list of field names in string format.
32-
*
33-
* @param <T> The resultant type for the target field
3432
*/
35-
abstract class AbstractStringProcessor<T> extends AbstractProcessor {
33+
abstract class AbstractStringProcessor extends AbstractProcessor {
3634
private final String field;
3735
private final boolean ignoreMissing;
3836
private final String targetField;
@@ -70,7 +68,7 @@ public final IngestDocument execute(IngestDocument document) {
7068
return document;
7169
}
7270

73-
protected abstract T process(String value);
71+
protected abstract Object process(String value);
7472

7573
abstract static class Factory implements Processor.Factory {
7674
final String processorType;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@
3131
import static org.hamcrest.Matchers.containsString;
3232
import static org.hamcrest.Matchers.equalTo;
3333

34-
public abstract class AbstractStringProcessorTestCase<T> extends ESTestCase {
34+
public abstract class AbstractStringProcessorTestCase extends ESTestCase {
3535

3636
protected abstract AbstractStringProcessor newProcessor(String field, boolean ignoreMissing, String targetField);
3737

3838
protected String modifyInput(String input) {
3939
return input;
4040
}
4141

42-
protected abstract T expectedResult(String input);
42+
protected abstract Object expectedResult(String input);
4343

44-
protected Class<T> expectedResultType(){
45-
return (Class<T>) String.class; // most results types are Strings
44+
protected Class<?> expectedResultType(){
45+
return String.class; // most results types are Strings
4646
}
4747

4848
public void testProcessor() throws Exception {

0 commit comments

Comments
 (0)