apache / apache/maven-filtering

Resource fields default to null instead of sensible empty values

Open Beginner friendly
#356 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
9
Forks
36
Avg merge
8h 47m
Merged PRs (30d)
4

Description

In `src/main/java/org/apache/maven/shared/filtering/Resource.java`, lines 31–36:

All six fields default to `null` rather than sensible empty values. The `getExtension()` method in `DefaultMavenResourcesFiltering` handles the edge case where `resource.getDirectory()` might be null (line 179), but every consumer must null-check these fields. For example, `Resource.getIncludes()` returns `null` by default, not an empty list, requiring null checks at all call sites like `DefaultMavenResourcesFiltering.setupScanner()` at line 410.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the six field declarations in src/main/java/org/apache/maven/shared/filtering/Resource.java, then inspect getExtension() in DefaultMavenResourcesFiltering and setupScanner() around line 410 to understand current null handling. Confirm the intended empty defaults for each field and verify that the affected consumers no longer need null values.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.