apache / apache/maven-war-plugin

OverlayManager.compareOverlayWithArtifact() treats null classifier as literal "null" string

Open Beginner friendly
#621 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
50
Forks
97
Avg merge
16h 49m
Merged PRs (30d)
3

Description

## Bug Description

`OverlayManager.compareOverlayWithArtifact()` at `src/main/java/org/apache/maven/plugins/war/overlay/OverlayManager.java` lines 205-206 uses `Objects.toString(overlay.getClassifier())` which converts a `null` classifier to the literal string `"null"` rather than `""`.

The adjacent comment explicitly states that `null` and `""` should be treated as equal for classifier comparison (MWAR-241), but this code treats them as distinct.

## Impact

Overlay-to-artifact matching fails when one side has a null classifier and the other has an empty string.

## Code

```java
// Line 205-206
Objects.toString(overlay.getClassifier())
// When overlay.getClassifier() is null, this returns "null" not ""
```

## Expected behavior

Use `Objects.toString(overlay.getClassifier(), "")` so that null is treated as empty string, matching the documented intent.

Contributor guide

No contributing guide indexed for this repository

Research direction

Open src/main/java/org/apache/maven/plugins/war/overlay/OverlayManager.java at lines 205-206 and read the adjacent MWAR-241 comment. Check the classifier comparison and verify that null and an empty classifier are treated as equal; the issue is done when overlay-to-artifact matching no longer distinguishes those two cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.