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

elharo pushed a commit to branch scanner
in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git


The following commit(s) were added to refs/heads/scanner by this push:
     new 4700c90f excludes
4700c90f is described below

commit 4700c90f06b4f7e594b10778dbce04c9a0b45e65
Author: Elliotte Rusty Harold <elh...@ibiblio.org>
AuthorDate: Sun Jul 9 22:40:39 2023 -0400

    excludes
---
 .../org/apache/maven/plugins/javadoc/FileAccumulator.java   | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/maven/plugins/javadoc/FileAccumulator.java 
b/src/main/java/org/apache/maven/plugins/javadoc/FileAccumulator.java
index a45210bc..f820b3f5 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/FileAccumulator.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/FileAccumulator.java
@@ -42,6 +42,12 @@ class FileAccumulator implements FileVisitor<Path> {
         for (String glob : sourceFileIncludes) {
             this.sourceFileIncludes.add(fileSystem.getPathMatcher("glob:" + 
glob));
         }
+
+        if (sourceFileExcludes != null) {
+            for (String glob : sourceFileExcludes) {
+                this.sourceFileExcludes.add(fileSystem.getPathMatcher("glob:" 
+ glob));
+            }
+        }
     }
 
     @Override
@@ -56,10 +62,15 @@ class FileAccumulator implements FileVisitor<Path> {
 
     @Override
     public FileVisitResult visitFile(Path path, BasicFileAttributes ex) throws 
IOException {
+        for (PathMatcher matcher : sourceFileExcludes) {
+            if (matcher.matches(path)) {
+                return FileVisitResult.CONTINUE;
+            }
+        }
         for (PathMatcher matcher : sourceFileIncludes) {
             if (matcher.matches(path)) {
                 includedFiles.add(base.relativize(path).toString());
-                break;
+                return FileVisitResult.CONTINUE;
             }
         }
         return FileVisitResult.CONTINUE;

Reply via email to