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

claude 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 c0bb2a58 RAT-98: simple non-functional changes (#440)
c0bb2a58 is described below

commit c0bb2a585a42433d1c18f5d695671190d46aa0db
Author: Claude Warren <[email protected]>
AuthorDate: Sun Feb 9 00:41:37 2025 +0100

    RAT-98: simple non-functional changes (#440)
    
    * simple non-functional changes
    
    * Minor changes during review
    
    ---------
    
    Co-authored-by: P. Ottlinger <[email protected]>
---
 .../src/main/java/org/apache/rat/analysis/TikaProcessor.java     | 9 ++++-----
 .../org/apache/rat/config/exclusion/plexus/SelectorUtils.java    | 1 -
 .../main/java/org/apache/rat/document/ArchiveEntryDocument.java  | 6 +++---
 .../src/test/java/org/apache/rat/anttasks/ReportOptionTest.java  | 2 +-
 4 files changed, 8 insertions(+), 10 deletions(-)

diff --git 
a/apache-rat-core/src/main/java/org/apache/rat/analysis/TikaProcessor.java 
b/apache-rat-core/src/main/java/org/apache/rat/analysis/TikaProcessor.java
index 5f128668..d437c773 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/analysis/TikaProcessor.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/analysis/TikaProcessor.java
@@ -39,11 +39,11 @@ import org.apache.tika.parser.txt.CharsetDetector;
 import org.apache.tika.parser.txt.CharsetMatch;
 
 /**
- * A wrapping around the tika processor.
+ * A wrapping around the Tika processor.
  */
 public final class TikaProcessor {
 
-    /** the Tika parser */
+    /** The Tika parser */
     private static final Tika TIKA = new Tika();
     /** A map of mime type string to non-BINARY types.
      * "text" types are already handled somewhere else
@@ -129,9 +129,9 @@ public final class TikaProcessor {
      * @throws RatDocumentAnalysisException on error.
      */
     public static String process(final Document document) throws 
RatDocumentAnalysisException {
-        Metadata metadata = new Metadata();
         try (InputStream stream = 
markSupportedInputStream(document.inputStream())) {
-            metadata.set(TikaCoreProperties.RESOURCE_NAME_KEY, 
document.getName().getName());
+            Metadata metadata = new Metadata();
+            metadata.set(TikaCoreProperties.RESOURCE_NAME_KEY, 
document.getName().getShortName());
             String result = TIKA.detect(stream, metadata);
             String[] parts = result.split("/");
             MediaType mediaType = new MediaType(parts[0], parts[1]);
@@ -146,7 +146,6 @@ public final class TikaProcessor {
                     
document.getMetaData().setDocumentType(Document.Type.NOTICE);
                 }
             }
-
             return result;
         } catch (IOException e) {
             throw new RatDocumentAnalysisException(e);
diff --git 
a/apache-rat-core/src/main/java/org/apache/rat/config/exclusion/plexus/SelectorUtils.java
 
b/apache-rat-core/src/main/java/org/apache/rat/config/exclusion/plexus/SelectorUtils.java
index 92c53528..923950f2 100644
--- 
a/apache-rat-core/src/main/java/org/apache/rat/config/exclusion/plexus/SelectorUtils.java
+++ 
b/apache-rat-core/src/main/java/org/apache/rat/config/exclusion/plexus/SelectorUtils.java
@@ -54,7 +54,6 @@ package org.apache.rat.config.exclusion.plexus;
  * <http://www.codehaus.org/>.
  *
  */
-
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
diff --git 
a/apache-rat-core/src/main/java/org/apache/rat/document/ArchiveEntryDocument.java
 
b/apache-rat-core/src/main/java/org/apache/rat/document/ArchiveEntryDocument.java
index 0553e433..dabc848b 100644
--- 
a/apache-rat-core/src/main/java/org/apache/rat/document/ArchiveEntryDocument.java
+++ 
b/apache-rat-core/src/main/java/org/apache/rat/document/ArchiveEntryDocument.java
@@ -36,12 +36,12 @@ public class ArchiveEntryDocument extends Document {
 
     /**
      * Creates an Archive entry.
-     * @param outerName the name of this entry from outside the archive.
+     * @param entryName the name of this entry from outside the archive.
      * @param contents the contents of the entry.
      * @param nameMatcher the name matcher to filter contents with.
      */
-    public ArchiveEntryDocument(final DocumentName outerName, final byte[] 
contents, final DocumentNameMatcher nameMatcher) {
-        super(outerName, nameMatcher);
+    public ArchiveEntryDocument(final ArchiveEntryName entryName, final byte[] 
contents, final DocumentNameMatcher nameMatcher) {
+        super(entryName, nameMatcher);
         this.contents = contents;
     }
 
diff --git 
a/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/ReportOptionTest.java 
b/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/ReportOptionTest.java
index 6d23f061..a1f13714 100644
--- 
a/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/ReportOptionTest.java
+++ 
b/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/ReportOptionTest.java
@@ -81,7 +81,7 @@ public class ReportOptionTest  {
             super(BaseAntTask.unsupportedArgs(), testPath.toFile());
         }
 
-        protected final ReportConfiguration generateConfig(List<Pair<Option, 
String[]>> args) {
+        protected ReportConfiguration generateConfig(final List<Pair<Option, 
String[]>> args) {
             BuildTask task = args.get(0).getKey() == null ? new BuildTask() : 
new BuildTask(args.get(0).getKey());
             task.setUp(args);
             task.buildRule.executeTarget(task.name);

Reply via email to