Skip to content

Commit

Permalink
Remove -Xlint exclusions in the ingest-common module.
Browse files Browse the repository at this point in the history
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 elastic#40366
  • Loading branch information
martijnvg committed Mar 27, 2019
1 parent 7e4d23d commit d8d9ab6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
3 changes: 0 additions & 3 deletions modules/ingest-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ dependencies {
compile project(':libs:dissect')
}

compileJava.options.compilerArgs << "-Xlint:-unchecked,-rawtypes"
compileTestJava.options.compilerArgs << "-Xlint:-unchecked,-rawtypes"

integTestCluster {
module project(':modules:lang-painless')
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@
/**
* Base class for processors that manipulate source strings and require a single "fields" array config value, which
* holds a list of field names in string format.
*
* @param <T> The resultant type for the target field
*/
abstract class AbstractStringProcessor<T> extends AbstractProcessor {
abstract class AbstractStringProcessor extends AbstractProcessor {
private final String field;
private final boolean ignoreMissing;
private final String targetField;
Expand Down Expand Up @@ -70,7 +68,7 @@ public final IngestDocument execute(IngestDocument document) {
return document;
}

protected abstract T process(String value);
protected abstract Object process(String value);

abstract static class Factory implements Processor.Factory {
final String processorType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;

public abstract class AbstractStringProcessorTestCase<T> extends ESTestCase {
public abstract class AbstractStringProcessorTestCase extends ESTestCase {

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

protected String modifyInput(String input) {
return input;
}

protected abstract T expectedResult(String input);
protected abstract Object expectedResult(String input);

protected Class<T> expectedResultType(){
return (Class<T>) String.class; // most results types are Strings
protected Class<?> expectedResultType(){
return String.class; // most results types are Strings
}

public void testProcessor() throws Exception {
Expand Down

0 comments on commit d8d9ab6

Please sign in to comment.