gnodet-bot commented on code in PR #399:
URL: https://github.com/apache/maven-filtering/pull/399#discussion_r4103256323
##########
src/main/java/org/apache/maven/shared/filtering/Resource.java:
##########
@@ -28,8 +28,8 @@
*/
public class Resource {
- List<String> includes;
- List<String> excludes;
+ List<String> includes = new ArrayList<>();
Review Comment:
The field is now eagerly initialized — good. However `setIncludes(List)`
(line 44) still does `this.includes = includes` without a null-guard, so a
caller can nullify the field after construction. Suggest:
```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]