This is an automated email from the ASF dual-hosted git repository.

pottlinger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/creadur-rat.git


The following commit(s) were added to refs/heads/master by this push:
     new b170cbce Apply minor code cleanups
b170cbce is described below

commit b170cbce1174ccb611602cbb0ff434f140dcbaf3
Author: P. Ottlinger <[email protected]>
AuthorDate: Fri Jan 24 12:31:04 2025 +0100

    Apply minor code cleanups
---
 apache-rat-core/src/main/java/org/apache/rat/report/RatReport.java | 2 +-
 .../rat/config/exclusion/fileProcessors/CVSFileProcessorTest.java  | 2 +-
 .../org/apache/rat/config/parameters/DescriptionBuilderTest.java   | 2 +-
 .../src/test/java/org/apache/rat/mp/RatCheckMojoTest.java          | 7 ++++---
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/apache-rat-core/src/main/java/org/apache/rat/report/RatReport.java 
b/apache-rat-core/src/main/java/org/apache/rat/report/RatReport.java
index e6bebf9b..4a0c41cb 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/report/RatReport.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/report/RatReport.java
@@ -44,7 +44,7 @@ public interface RatReport {
      * @throws RatException on error.
      */
     default void report(Document document) throws RatException {
-    };
+    }
 
     /**
      * Signals the end of execution for the report. Will be called after the 
{@code report()} method
diff --git 
a/apache-rat-core/src/test/java/org/apache/rat/config/exclusion/fileProcessors/CVSFileProcessorTest.java
 
b/apache-rat-core/src/test/java/org/apache/rat/config/exclusion/fileProcessors/CVSFileProcessorTest.java
index 57d0d35f..7900fd7e 100644
--- 
a/apache-rat-core/src/test/java/org/apache/rat/config/exclusion/fileProcessors/CVSFileProcessorTest.java
+++ 
b/apache-rat-core/src/test/java/org/apache/rat/config/exclusion/fileProcessors/CVSFileProcessorTest.java
@@ -19,7 +19,7 @@
 package org.apache.rat.config.exclusion.fileProcessors;
 
 import java.util.ArrayList;
-import org.apache.rat.utils.DefaultLog;
+
 import org.apache.rat.utils.ExtendedIterator;
 import org.junit.jupiter.api.Test;
 
diff --git 
a/apache-rat-core/src/test/java/org/apache/rat/config/parameters/DescriptionBuilderTest.java
 
b/apache-rat-core/src/test/java/org/apache/rat/config/parameters/DescriptionBuilderTest.java
index 24187c5e..a4ef65ca 100644
--- 
a/apache-rat-core/src/test/java/org/apache/rat/config/parameters/DescriptionBuilderTest.java
+++ 
b/apache-rat-core/src/test/java/org/apache/rat/config/parameters/DescriptionBuilderTest.java
@@ -99,7 +99,7 @@ public class DescriptionBuilderTest {
 
     /** Class to build a list of documents that are class files. */
     private static class DocumentProcessor implements Consumer<Document> {
-        SortedSet<Document> documents = new TreeSet<>();
+        final SortedSet<Document> documents = new TreeSet<>();
         @Override
         public void accept(Document document) {
             if (document.isDirectory()) {
diff --git 
a/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java 
b/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java
index c104bf7c..e9a1ab8f 100644
--- a/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java
+++ b/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java
@@ -27,6 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import java.io.File;
 
 import java.io.FileInputStream;
+import java.nio.file.Files;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -127,7 +128,7 @@ public class RatCheckMojoTest extends 
BetterAbstractMojoTestCase {
         data.put(ClaimStatistic.Counter.UNAPPROVED, "0");
         data.put(ClaimStatistic.Counter.UNKNOWN, "0");
 
-        org.w3c.dom.Document document = XmlUtils.toDom(new 
FileInputStream(ratTxtFile));
+        org.w3c.dom.Document document = 
XmlUtils.toDom(Files.newInputStream(ratTxtFile.toPath()));
         XPath xPath = XPathFactory.newInstance().newXPath();
 
         for (ClaimStatistic.Counter counter : ClaimStatistic.Counter.values()) 
{
@@ -252,7 +253,7 @@ public class RatCheckMojoTest extends 
BetterAbstractMojoTestCase {
         data.put(ClaimStatistic.Counter.UNAPPROVED, "4");
         data.put(ClaimStatistic.Counter.UNKNOWN, "0");
 
-        org.w3c.dom.Document document = XmlUtils.toDom(new 
FileInputStream(ratTxtFile));
+        org.w3c.dom.Document document = 
XmlUtils.toDom(Files.newInputStream(ratTxtFile.toPath()));
         XPath xPath = XPathFactory.newInstance().newXPath();
 
         for (ClaimStatistic.Counter counter : ClaimStatistic.Counter.values()) 
{
@@ -367,7 +368,7 @@ public class RatCheckMojoTest extends 
BetterAbstractMojoTestCase {
             data.put(ClaimStatistic.Counter.UNAPPROVED, "4");
             data.put(ClaimStatistic.Counter.UNKNOWN, "4");
 
-            org.w3c.dom.Document document = XmlUtils.toDom(new 
FileInputStream(ratTxtFile));
+            org.w3c.dom.Document document = 
XmlUtils.toDom(Files.newInputStream(ratTxtFile.toPath()));
             XPath xPath = XPathFactory.newInstance().newXPath();
 
             for (ClaimStatistic.Counter counter : 
ClaimStatistic.Counter.values()) {

Reply via email to