Skip to content

Null map values in manifest entries silently converted to empty strings #374

Description

@elharo

Affected version: all

Description:

MavenArchiveConfiguration.setManifestEntries() at line 196 accepts a map that may contain null values:

public void setManifestEntries(Map<String, String> 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<String, String> 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions