Fix a SpotBugs warning 07/110107/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 31 Jan 2024 13:19:17 +0000 (14:19 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 31 Jan 2024 13:20:04 +0000 (14:20 +0100)
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 <robert.varga@pantheon.tech>
features-test-plugin/pom.xml
features-test-plugin/src/main/java/org/opendaylight/odlparent/features/test/plugin/PaxExamExecution.java

index aebf0631c480d70dea2998f23cd5f9fbf49991cd..2c4b1b857d9c8bb904aab56f6a8cb840cebef7b4 100644 (file)
             <artifactId>junit</artifactId>
             <scope>compile</scope>
         </dependency>
-
-        <dependency>
-            <groupId>com.github.spotbugs</groupId>
-            <artifactId>spotbugs-annotations</artifactId>
-            <optional>true</optional>
-        </dependency>
     </dependencies>
 
     <build>
             </plugin>
         </plugins>
     </build>
-</project>
\ No newline at end of file
+</project>
index 2776fe24fff475a35e9c8e0363453110ba27af66..e94d385f31f1c1ca717732788b49b69f8518b673 100644 (file)
@@ -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 {