From ff6cab0cc0ad1d494013f188e3e7fad49363e84a Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 31 Jan 2024 14:19:17 +0100 Subject: [PATCH] Fix a SpotBugs warning Use UTF8 encoding, not that it really matters. This allows us to not propagate spotbugs to runtime. JIRA: ODLPARENT-262 Change-Id: I51daaa041c810c5ab60d4d8cf080d928ab0dd0a1 Signed-off-by: Robert Varga --- features-test-plugin/pom.xml | 8 +------- .../odlparent/features/test/plugin/PaxExamExecution.java | 5 ++--- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/features-test-plugin/pom.xml b/features-test-plugin/pom.xml index aebf0631c..2c4b1b857 100644 --- a/features-test-plugin/pom.xml +++ b/features-test-plugin/pom.xml @@ -160,12 +160,6 @@ junit compile - - - com.github.spotbugs - spotbugs-annotations - true - @@ -203,4 +197,4 @@ - \ No newline at end of file + diff --git a/features-test-plugin/src/main/java/org/opendaylight/odlparent/features/test/plugin/PaxExamExecution.java b/features-test-plugin/src/main/java/org/opendaylight/odlparent/features/test/plugin/PaxExamExecution.java index 2776fe24f..e94d385f3 100644 --- a/features-test-plugin/src/main/java/org/opendaylight/odlparent/features/test/plugin/PaxExamExecution.java +++ b/features-test-plugin/src/main/java/org/opendaylight/odlparent/features/test/plugin/PaxExamExecution.java @@ -9,10 +9,10 @@ package org.opendaylight.odlparent.features.test.plugin; import static java.util.Objects.requireNonNull; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.IOException; import java.io.OutputStream; import java.io.PrintStream; +import java.nio.charset.StandardCharsets; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.maven.plugin.MojoExecutionException; import org.ops4j.pax.exam.ExamSystem; @@ -30,7 +30,6 @@ final class PaxExamExecution { } @SuppressWarnings({"IllegalCatch", "RegexpSinglelineJava"}) - @SuppressFBWarnings("DM_DEFAULT_ENCODING") void execute() throws MojoExecutionException { // Use the same repository for Pax Exam as is used for Maven @@ -39,7 +38,7 @@ final class PaxExamExecution { for (var container : containers) { // disable karaf stdout output to maven log final var stdout = System.out; - System.setOut(new PrintStream(OutputStream.nullOutputStream())); + System.setOut(new PrintStream(OutputStream.nullOutputStream(), true, StandardCharsets.UTF_8)); final var containerStarted = new AtomicBoolean(false); try { -- 2.36.6