gnodet-bot commented on code in PR #399:
URL: https://github.com/apache/maven-filtering/pull/399#discussion_r4103301106


##########
src/main/java/org/apache/maven/shared/filtering/Resource.java:
##########
@@ -29,8 +29,8 @@
  */
 public class Resource {
 
-    List<String> includes;
-    List<String> excludes;
+    List<String> includes = new ArrayList<>();

Review Comment:
   ⚠️ **Not addressed from previous review:** The eager initialization here is 
good, but the corresponding setters (`setIncludes` at line 44, `setExcludes` at 
line 52) still accept `null` without guarding. A caller doing 
`resource.setIncludes(null)` re-nullifies this field, and the null-check 
removals in `DefaultMavenResourcesFiltering.setupScanner()` and the debug log 
block will NPE.
   
   The setters need null guards:
   ```java
   public void setIncludes(List<String> includes) {
       this.includes = includes != null ? includes : new ArrayList<>();
   }
   ```
   (Same for `setExcludes`.)



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