tkobayas commented on issue #6265:
URL: 
https://github.com/apache/incubator-kie-drools/issues/6265#issuecomment-2687248488

   apache-rat 0.16.1
   
   https://github.com/apache/creadur-rat/tree/apache-rat-project-0.16.1
   
   `Report.parseExclusions()` creates 3 filters based on the exclusion 
expression (e.g. `drools-model`)
   ```java
                   orFilter.addFileFilter(new RegexFileFilter(exclusion));
                   orFilter.addFileFilter(new NameFileFilter(exclusion));
                   
orFilter.addFileFilter(WildcardFileFilter.builder().setWildcards(exclusion).get());
   ```
   
   All those filters checks the incoming file name. Both file 
`kie-dmn/kie-dmn-core/src/test/filtered-resources/org/kie/dmn/core/drools-model`
 and directory `drools-model` are checked as the same name `drools-model`, so 
there is no way to make a difference.
   
   `RegexFileFilter.accept()`
   ```java
       public boolean accept(final File dir, final String name) {
           return pattern.matcher(name).matches();
       }
   ```
   
   `NameFileFilter.accept()`
   ```java
       public boolean accept(final File dir, final String name) {
           return acceptBaseName(name);
       }
   
       private boolean acceptBaseName(final String baseName) {
           return Stream.of(names).anyMatch(testName -> 
ioCase.checkEquals(baseName, testName));
       }
   ```
   
   `WildcardFileFilter.accept()`
   ```java
       public boolean accept(final File dir, final String name) {
           return accept(name);
       }
   
       private boolean accept(final String name) {
           return Stream.of(wildcards).anyMatch(wildcard -> 
FilenameUtils.wildcardMatch(name, wildcard, ioCase));
       }
   ```


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to