apache / apache/maven-archiver
Null map values in manifest entries silently converted to empty strings
- Dominant language
- Java
- Stars
- 13
- Forks
- 26
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 7
Description
**Affected version:** all
**Description:**
`MavenArchiveConfiguration.setManifestEntries()` at line 196 accepts a map that may contain null values:
```java
public void setManifestEntries(Map manifestEntries) {
this.manifestEntries = manifestEntries;
}
```
When a null value flows through `MavenArchiver.addManifestAttribute()`, the sanitize logic converts it to an empty string attribute (intentional behavior per the existing test at `MavenArchiverTest.java:439` which passes `"keyWithEmptyValue", null` and expects it to produce an empty entry in the manifest).
The concern is not the behavior itself, but that null values in a Map are silently accepted. A null value in a `Map` is typically a programming error (e.g., trying to look up a configuration value that doesn't exist and forgetting to guard the result). Silently converting to empty string masks the mistake.
Low priority — intentional design choice, but worth noting.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with MavenArchiveConfiguration.setManifestEntries() around line 196 and follow the map into MavenArchiver.addManifestAttribute(). Read the existing MavenArchiverTest.java test around line 439, which documents null becoming an empty manifest value. Before changing behavior, clarify whether null values should be rejected or continue producing empty entries; done means the chosen behavior is explicit and covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100