ottlinger commented on code in PR #655:
URL: https://github.com/apache/creadur-rat/pull/655#discussion_r4117107189


##########
apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java:
##########


Review Comment:
   Is Ant able to use the new HTML5 report style as well?



##########
apache-rat-core/src/main/java/org/apache/rat/commandline/Converters.java:
##########


Review Comment:
   Why can't we have a FileConverter(DocumentName dN) constructur instead of 
the private constructor with the static variable?
   All test invocations call setWorkingDirectory(...) first?
   
   Wouldn't a new FileConverter(myWorkingDir) be simpler and more 
straightforward here?



##########
apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/DataUtils.java:
##########
@@ -0,0 +1,148 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ */
+package org.apache.rat.testhelpers.data;
+
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Locale;
+import java.util.function.Consumer;
+import org.apache.commons.cli.Option;
+import org.apache.rat.report.xml.writer.XmlWriter;
+import org.apache.rat.utils.CasedString;
+import org.apache.rat.utils.DefaultLog;
+
+/**
+ * A collection of static methods to create data.
+ */
+public class DataUtils {
+    /**
+     * The text for the current ASF license.
+     */
+    public static final String[] ASF_TEXT_LINES = {
+            "Licensed to the Apache Software Foundation (ASF) under one or 
more",
+            "contributor license agreements.  See the NOTICE file distributed 
with",
+            "this work for additional information regarding copyright 
ownership.",
+            "The ASF licenses this file to You under the Apache License, 
Version 2.0",
+            "(the \"License\"); you may not use this file except in compliance 
with",
+            "the License.  You may obtain a copy of the License at",
+            "  ",
+            "    https://www.apache.org/licenses/LICENSE-2.0";,
+            "  ",
+            "Unless required by applicable law or agreed to in writing, 
software",
+            "distributed under the License is distributed on an \"AS IS\" 
BASIS,",
+            "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
implied.",
+            "See the License for the specific language governing permissions 
and",
+            "limitations under the License."
+    };
+
+    /**
+     * The text for the current ASF license as a block of text with new lines.
+     */
+    public static final String ASF_TEXT = String.join("\n" ,ASF_TEXT_LINES);
+
+    /**
+     * A setup that does nothing.
+     */
+    public static final Consumer<Path> NO_SETUP = basePath -> {
+        DefaultLog.getInstance().warn("no setup for " + basePath);
+    };
+
+    /**
+     * A ValidatorData consumer that does nothing.
+     */
+    public static final Consumer<ValidatorData> NO_VALIDATOR = validatorData 
-> {};

Review Comment:
   is marked as unused?



##########
apache-rat-tools/src/test/java/org/apache/rat/documentation/options/MavenOptionTest.java:
##########
@@ -32,7 +32,7 @@ void getDeprecatedTest() {
         for (Option option : Arg.getOptions().getOptions()) {
             if (option.isDeprecated()) {
                 mavenOptionCollection.getMappedOption(option).ifPresent( 
mavenOption -> //
-                        
assertThat(mavenOption.getDeprecated()).doesNotContainPattern("\\-\\- "));
+                        
assertThat(mavenOption.getDeprecated()).doesNotContainPattern("-\\- "));

Review Comment:
   Thanks.



##########
apache-rat-core/src/test/java/org/apache/rat/config/results/ClaimValidatorTest.java:
##########
@@ -125,16 +128,17 @@ void logIssuesTest() {
                 statistic.incCounter(counter, expected);
                 validator.logIssues(statistic);
                 assertThat(log.getCaptured()).isNotEmpty();
-                required.entrySet().stream().filter(e -> e.getKey() != counter)
-                        .map(Map.Entry::getValue).forEach(log::assertContains);
+                List<String> expectedEntries = 
required.entrySet().stream().filter(e -> e.getKey() != counter)
+                        .map(Map.Entry::getValue).toList();
+                assertThat(log.getCaptured()).contains(expectedEntries);
                 if (required.entrySet().contains(counter)) {

Review Comment:
   The IDE issues a warning that I do not understand ....
   `"Set<Entry<Counter,String>> may not contain objects of type 'Counter'"
   `albeit it is defined as 
   ` Map<ClaimStatistic.Counter, String>
   `on line 118
   
   Not sure how to get rid of the warning - do you have a clue?



##########
apache-rat-core/src/test/java/org/apache/rat/test/AbstractOptionsProvider.java:
##########


Review Comment:
   Method preserveData(...) is marked as unused ....??



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to