diff --git a/modules/ingest-common/build.gradle b/modules/ingest-common/build.gradle index 1681258e7c7ee..b6179eb852ae9 100644 --- a/modules/ingest-common/build.gradle +++ b/modules/ingest-common/build.gradle @@ -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') } \ No newline at end of file diff --git a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/AbstractStringProcessor.java b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/AbstractStringProcessor.java index 792e5e4ebed2d..546519aa5f606 100644 --- a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/AbstractStringProcessor.java +++ b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/AbstractStringProcessor.java @@ -80,8 +80,8 @@ protected Factory(String processorType) { } @Override - public AbstractStringProcessor create(Map registry, String tag, - Map config) throws Exception { + public AbstractStringProcessor create(Map registry, String tag, + Map config) throws Exception { String field = ConfigurationUtils.readStringProperty(processorType, tag, config, "field"); boolean ignoreMissing = ConfigurationUtils.readBooleanProperty(processorType, tag, config, "ignore_missing", false); String targetField = ConfigurationUtils.readStringProperty(processorType, tag, config, "target_field", field); @@ -89,7 +89,7 @@ public AbstractStringProcessor create(Map registry, S return newProcessor(tag, config, field, ignoreMissing, targetField); } - protected abstract AbstractStringProcessor newProcessor(String processorTag, Map config, String field, - boolean ignoreMissing, String targetField); + protected abstract AbstractStringProcessor newProcessor(String processorTag, Map config, String field, + boolean ignoreMissing, String targetField); } } diff --git a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/BytesProcessor.java b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/BytesProcessor.java index d07b56e1b3df5..8de75878f5fe5 100644 --- a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/BytesProcessor.java +++ b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/BytesProcessor.java @@ -27,7 +27,7 @@ * Processor that converts the content of string fields to the byte value. * Throws exception is the field is not of type string or can not convert to the numeric byte value */ -public final class BytesProcessor extends AbstractStringProcessor { +public final class BytesProcessor extends AbstractStringProcessor { public static final String TYPE = "bytes"; diff --git a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GsubProcessor.java b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GsubProcessor.java index 39553910692fc..9f3e656bba4b6 100644 --- a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GsubProcessor.java +++ b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GsubProcessor.java @@ -29,7 +29,7 @@ * Processor that allows to search for patterns in field content and replace them with corresponding string replacement. * Support fields of string type only, throws exception if a field is of a different type. */ -public final class GsubProcessor extends AbstractStringProcessor { +public final class GsubProcessor extends AbstractStringProcessor { public static final String TYPE = "gsub"; @@ -67,8 +67,8 @@ public Factory() { } @Override - protected AbstractStringProcessor newProcessor(String processorTag, Map config, String field, - boolean ignoreMissing, String targetField) { + protected GsubProcessor newProcessor(String processorTag, Map config, String field, + boolean ignoreMissing, String targetField) { String pattern = readStringProperty(TYPE, processorTag, config, "pattern"); String replacement = readStringProperty(TYPE, processorTag, config, "replacement"); Pattern searchPattern; diff --git a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/LowercaseProcessor.java b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/LowercaseProcessor.java index 4269cb05257f5..6c14dbdabba78 100644 --- a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/LowercaseProcessor.java +++ b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/LowercaseProcessor.java @@ -27,7 +27,7 @@ * Throws exception is the field is not of type string. */ -public final class LowercaseProcessor extends AbstractStringProcessor { +public final class LowercaseProcessor extends AbstractStringProcessor { public static final String TYPE = "lowercase"; diff --git a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/TrimProcessor.java b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/TrimProcessor.java index 98fe1223e5391..d1b3c87785424 100644 --- a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/TrimProcessor.java +++ b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/TrimProcessor.java @@ -25,7 +25,7 @@ * Processor that trims the content of string fields. * Throws exception is the field is not of type string. */ -public final class TrimProcessor extends AbstractStringProcessor { +public final class TrimProcessor extends AbstractStringProcessor { public static final String TYPE = "trim"; diff --git a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/URLDecodeProcessor.java b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/URLDecodeProcessor.java index fb6c5acf98b24..fa9d377714ee9 100644 --- a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/URLDecodeProcessor.java +++ b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/URLDecodeProcessor.java @@ -26,7 +26,7 @@ /** * Processor that URL-decodes a string */ -public final class URLDecodeProcessor extends AbstractStringProcessor { +public final class URLDecodeProcessor extends AbstractStringProcessor { public static final String TYPE = "urldecode"; diff --git a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/UppercaseProcessor.java b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/UppercaseProcessor.java index 6c428627c7d72..4503bfc02f71e 100644 --- a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/UppercaseProcessor.java +++ b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/UppercaseProcessor.java @@ -26,7 +26,7 @@ * Processor that converts the content of string fields to uppercase. * Throws exception is the field is not of type string. */ -public final class UppercaseProcessor extends AbstractStringProcessor { +public final class UppercaseProcessor extends AbstractStringProcessor { public static final String TYPE = "uppercase"; diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/AbstractStringProcessorFactoryTestCase.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/AbstractStringProcessorFactoryTestCase.java index 0465e24902842..ba6a2be73465e 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/AbstractStringProcessorFactoryTestCase.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/AbstractStringProcessorFactoryTestCase.java @@ -37,7 +37,7 @@ protected Map modifyConfig(Map config) { return config; } - protected void assertProcessor(AbstractStringProcessor processor) {} + protected void assertProcessor(AbstractStringProcessor processor) {} public void testCreate() throws Exception { AbstractStringProcessor.Factory factory = newFactory(); @@ -47,7 +47,7 @@ public void testCreate() throws Exception { Map config = new HashMap<>(); config.put("field", fieldName); - AbstractStringProcessor processor = factory.create(null, processorTag, modifyConfig(config)); + AbstractStringProcessor processor = factory.create(null, processorTag, modifyConfig(config)); assertThat(processor.getTag(), equalTo(processorTag)); assertThat(processor.getField(), equalTo(fieldName)); assertThat(processor.isIgnoreMissing(), is(false)); @@ -64,7 +64,7 @@ public void testCreateWithIgnoreMissing() throws Exception { config.put("field", fieldName); config.put("ignore_missing", true); - AbstractStringProcessor processor = factory.create(null, processorTag, modifyConfig(config)); + AbstractStringProcessor processor = factory.create(null, processorTag, modifyConfig(config)); assertThat(processor.getTag(), equalTo(processorTag)); assertThat(processor.getField(), equalTo(fieldName)); assertThat(processor.isIgnoreMissing(), is(true)); @@ -82,7 +82,7 @@ public void testCreateWithTargetField() throws Exception { config.put("field", fieldName); config.put("target_field", targetFieldName); - AbstractStringProcessor processor = factory.create(null, processorTag, modifyConfig(config)); + AbstractStringProcessor processor = factory.create(null, processorTag, modifyConfig(config)); assertThat(processor.getTag(), equalTo(processorTag)); assertThat(processor.getField(), equalTo(fieldName)); assertThat(processor.isIgnoreMissing(), is(false)); diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/AbstractStringProcessorTestCase.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/AbstractStringProcessorTestCase.java index 4e4182bfdc891..f667f84e5d7b1 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/AbstractStringProcessorTestCase.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/AbstractStringProcessorTestCase.java @@ -33,7 +33,7 @@ public abstract class AbstractStringProcessorTestCase extends ESTestCase { - protected abstract AbstractStringProcessor newProcessor(String field, boolean ignoreMissing, String targetField); + protected abstract AbstractStringProcessor newProcessor(String field, boolean ignoreMissing, String targetField); protected String modifyInput(String input) { return input; @@ -41,8 +41,8 @@ protected String modifyInput(String input) { protected abstract T expectedResult(String input); - protected Class expectedResultType(){ - return (Class) String.class; // most results types are Strings + protected Class expectedResultType(){ + return String.class; // most results types are Strings } public void testProcessor() throws Exception { diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/BytesProcessorTests.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/BytesProcessorTests.java index 788340a455a42..2520f3e5ad17f 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/BytesProcessorTests.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/BytesProcessorTests.java @@ -29,12 +29,12 @@ import static org.hamcrest.Matchers.equalTo; -public class BytesProcessorTests extends AbstractStringProcessorTestCase { +public class BytesProcessorTests extends AbstractStringProcessorTestCase { private String modifiedInput; @Override - protected AbstractStringProcessor newProcessor(String field, boolean ignoreMissing, String targetField) { + protected AbstractStringProcessor newProcessor(String field, boolean ignoreMissing, String targetField) { return new BytesProcessor(randomAlphaOfLength(10), field, ignoreMissing, targetField); } diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/GsubProcessorFactoryTests.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/GsubProcessorFactoryTests.java index 4a70b4686e0a6..0dadefbb4ee64 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/GsubProcessorFactoryTests.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/GsubProcessorFactoryTests.java @@ -42,7 +42,7 @@ protected Map modifyConfig(Map config) { } @Override - protected void assertProcessor(AbstractStringProcessor processor) { + protected void assertProcessor(AbstractStringProcessor processor) { GsubProcessor gsubProcessor = (GsubProcessor) processor; assertThat(gsubProcessor.getPattern().toString(), equalTo("\\.")); assertThat(gsubProcessor.getReplacement(), equalTo("-")); diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/GsubProcessorTests.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/GsubProcessorTests.java index 38d0202d3a1e2..9c003356c3dff 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/GsubProcessorTests.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/GsubProcessorTests.java @@ -21,10 +21,10 @@ import java.util.regex.Pattern; -public class GsubProcessorTests extends AbstractStringProcessorTestCase { +public class GsubProcessorTests extends AbstractStringProcessorTestCase { @Override - protected AbstractStringProcessor newProcessor(String field, boolean ignoreMissing, String targetField) { + protected AbstractStringProcessor newProcessor(String field, boolean ignoreMissing, String targetField) { return new GsubProcessor(randomAlphaOfLength(10), field, Pattern.compile("\\."), "-", ignoreMissing, targetField); } diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/LowercaseProcessorTests.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/LowercaseProcessorTests.java index 67a73669c0387..b804d3a0221c2 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/LowercaseProcessorTests.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/LowercaseProcessorTests.java @@ -21,9 +21,9 @@ import java.util.Locale; -public class LowercaseProcessorTests extends AbstractStringProcessorTestCase { +public class LowercaseProcessorTests extends AbstractStringProcessorTestCase { @Override - protected AbstractStringProcessor newProcessor(String field, boolean ignoreMissing, String targetField) { + protected AbstractStringProcessor newProcessor(String field, boolean ignoreMissing, String targetField) { return new LowercaseProcessor(randomAlphaOfLength(10), field, ignoreMissing, targetField); } diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/TrimProcessorTests.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/TrimProcessorTests.java index f0ae554f5cad1..abd7cae12fe91 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/TrimProcessorTests.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/TrimProcessorTests.java @@ -19,10 +19,10 @@ package org.elasticsearch.ingest.common; -public class TrimProcessorTests extends AbstractStringProcessorTestCase { +public class TrimProcessorTests extends AbstractStringProcessorTestCase { @Override - protected AbstractStringProcessor newProcessor(String field, boolean ignoreMissing, String targetField) { + protected AbstractStringProcessor newProcessor(String field, boolean ignoreMissing, String targetField) { return new TrimProcessor(randomAlphaOfLength(10), field, ignoreMissing, targetField); } diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/URLDecodeProcessorTests.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/URLDecodeProcessorTests.java index 7697f1fcba3d4..150d594afd9af 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/URLDecodeProcessorTests.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/URLDecodeProcessorTests.java @@ -22,14 +22,14 @@ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; -public class URLDecodeProcessorTests extends AbstractStringProcessorTestCase { +public class URLDecodeProcessorTests extends AbstractStringProcessorTestCase { @Override protected String modifyInput(String input) { return "Hello%20G%C3%BCnter" + input; } @Override - protected AbstractStringProcessor newProcessor(String field, boolean ignoreMissing, String targetField) { + protected AbstractStringProcessor newProcessor(String field, boolean ignoreMissing, String targetField) { return new URLDecodeProcessor(randomAlphaOfLength(10), field, ignoreMissing, targetField); } diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/UppercaseProcessorTests.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/UppercaseProcessorTests.java index 76459f8116890..1b027c4380837 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/UppercaseProcessorTests.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/UppercaseProcessorTests.java @@ -21,10 +21,10 @@ import java.util.Locale; -public class UppercaseProcessorTests extends AbstractStringProcessorTestCase { +public class UppercaseProcessorTests extends AbstractStringProcessorTestCase { @Override - protected AbstractStringProcessor newProcessor(String field, boolean ignoreMissing, String targetField) { + protected AbstractStringProcessor newProcessor(String field, boolean ignoreMissing, String targetField) { return new UppercaseProcessor(randomAlphaOfLength(10), field, ignoreMissing, targetField); }