From ac93eff5cc17408042e41acc013388905bb442ee Mon Sep 17 00:00:00 2001 From: Dinu John <86094133+dinujoh@users.noreply.github.com> Date: Tue, 17 Sep 2024 14:59:39 -0500 Subject: [PATCH] Remove unused imports Signed-off-by: Dinu John <86094133+dinujoh@users.noreply.github.com> --- .../processor/mutatestring/ReplaceStringProcessor.java | 3 --- .../processor/mutatestring/ReplaceStringProcessorTests.java | 6 ++---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/data-prepper-plugins/mutate-string-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutatestring/ReplaceStringProcessor.java b/data-prepper-plugins/mutate-string-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutatestring/ReplaceStringProcessor.java index c26670dd23..adf3ec9f23 100644 --- a/data-prepper-plugins/mutate-string-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutatestring/ReplaceStringProcessor.java +++ b/data-prepper-plugins/mutate-string-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutatestring/ReplaceStringProcessor.java @@ -14,10 +14,7 @@ import org.opensearch.dataprepper.model.plugin.InvalidPluginConfigurationException; import org.opensearch.dataprepper.model.processor.Processor; -import java.util.HashMap; -import java.util.Map; import java.util.Objects; -import java.util.regex.Pattern; /** * This processor takes in a key and changes its value by replacing each occurrence of from substring to target substring. diff --git a/data-prepper-plugins/mutate-string-processors/src/test/java/org/opensearch/dataprepper/plugins/processor/mutatestring/ReplaceStringProcessorTests.java b/data-prepper-plugins/mutate-string-processors/src/test/java/org/opensearch/dataprepper/plugins/processor/mutatestring/ReplaceStringProcessorTests.java index 1092e89f2b..a552596d38 100644 --- a/data-prepper-plugins/mutate-string-processors/src/test/java/org/opensearch/dataprepper/plugins/processor/mutatestring/ReplaceStringProcessorTests.java +++ b/data-prepper-plugins/mutate-string-processors/src/test/java/org/opensearch/dataprepper/plugins/processor/mutatestring/ReplaceStringProcessorTests.java @@ -28,7 +28,6 @@ import java.util.List; import java.util.Map; import java.util.UUID; -import java.util.regex.PatternSyntaxException; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; @@ -176,9 +175,8 @@ public boolean equals(Object other) { private ReplaceStringProcessorConfig.Entry createEntry(final String source, final String from, final String to, final String ReplaceWhen) { final EventKey sourceKey = eventKeyFactory.createEventKey(source); - final ReplaceStringProcessorConfig.Entry entry = new ReplaceStringProcessorConfig.Entry(sourceKey, from, to, ReplaceWhen); - return entry; + return new ReplaceStringProcessorConfig.Entry(sourceKey, from, to, ReplaceWhen); } private ReplaceStringProcessor createObjectUnderTest() { @@ -186,7 +184,7 @@ private ReplaceStringProcessor createObjectUnderTest() { } private Record getEvent(Object message) { - final Map testData = new HashMap(); + final Map testData = new HashMap<>(); testData.put("message", message); return buildRecordWithEvent(testData); }