gnodet commented on code in PR #395:
URL: https://github.com/apache/maven-filtering/pull/395#discussion_r4094995433


##########
src/main/java/org/apache/maven/shared/filtering/MavenFileFilter.java:
##########
@@ -71,4 +71,25 @@ void copyFile(
      */
     void copyFile(Path from, Path to, boolean filtering, List<FilterWrapper> 
filterWrappers, String encoding)
             throws MavenFilteringException;
+
+    /**
+     * @param from The source file
+     * @param to The target file
+     * @param filtering true to apply filtering
+     * @param filterWrappers {@link List} of FileUtils.FilterWrapper
+     * @param encoding The encoding used during the filtering.
+     * @param gracefulBinaryHandling when {@code true}, files that cause
+     *        {@link java.nio.charset.MalformedInputException} are copied 
as-is with a warning
+     *        instead of failing the build
+     * @throws MavenFilteringException In case of an error.
+     * @since 3.4.0
+     */
+    void copyFile(
+            Path from,
+            Path to,
+            boolean filtering,
+            List<FilterWrapper> filterWrappers,
+            String encoding,
+            boolean gracefulBinaryHandling)
+            throws MavenFilteringException;
 }

Review Comment:
   Fixed in 1219140: the 6-arg `copyFile` is now a `default` method in the 
`MavenFileFilter` interface, delegating to the 5-arg overload. Existing 
implementations won't need to override it (they get 
gracefulBinaryHandling=false by default), while `DefaultMavenFileFilter` 
retains its override with full behaviour.



##########
src/main/java/org/apache/maven/shared/filtering/DefaultMavenResourcesFiltering.java:
##########
@@ -261,6 +262,7 @@ public void filterResources(MavenResourcesExecution 
mavenResourcesExecution) thr
                 }
                 boolean filteredExt = filteredFileExtension(
                         source.getFileName().toString(), 
mavenResourcesExecution.getNonFilteredFileExtensions());
+                boolean filteredGlob = !matchesNonFilteredGlob(name, 
resource.getNonFilteredFiles());
                 if (resource.isFiltering() && isPropertiesFile(source)) {
                     propertiesFiles.add(source);

Review Comment:
   Fixed in 1219140: the `propertiesFiles.add(source)` condition now also gates 
on `filteredExt && filteredGlob`, consistent with the actual `copyFile` call 
condition. A `.properties` file excluded by a nonFilteredFiles glob pattern 
will no longer appear in the end-of-run encoding notice.



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