gnodet-bot commented on code in PR #411:
URL: https://github.com/apache/maven-archiver/pull/411#discussion_r4107900163


##########
src/main/java/org/apache/maven/shared/archiver/MavenArchiveConfiguration.java:
##########
@@ -152,19 +152,29 @@ public void setManifest(ManifestConfiguration manifest) {
     }
 
     /**
-     * <p>addManifestEntry.</p>
+     * Adds a single manifest entry.
      *
-     * @param key the key of the entry
-     * @param value the value of the entry
+     * <p>A {@code null} value is accepted and will produce an empty-string 
attribute in the manifest.
+     * This is intentional: it allows callers to explicitly request an empty 
manifest entry.
+     * Be careful not to pass {@code null} unintentionally (e.g., from an 
unguarded map lookup),
+     * as the resulting empty attribute will not indicate any error.</p>
+     *
+     * @param key the manifest attribute name
+     * @param value the manifest attribute value; {@code null} is treated as 
an empty string

Review Comment:
   💡 The PR description says it documents the contract "on all the relevant 
public methods," but `ManifestSection` has the same `addManifestEntry(String, 
String)`, `addManifestEntries(Map)`, and `getManifestEntries()` methods that 
follow the exact same null-value path — values stored here are later sanitized 
via `sanitizeManifestValue()` in `MavenArchiver` (line 169). They should get 
the same Javadoc treatment for completeness.



-- 
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]

Reply via email to