gnodet-bot commented on code in PR #13348:
URL: https://github.com/apache/maven/pull/13348#discussion_r4205696044


##########
api/maven-api-model/src/main/mdo/maven.mdo:
##########
@@ -2589,6 +2589,17 @@
             <li>{@code combine.self}: available values are {@code merge} 
(default) and {@code override}.</li>
             </ul>
 
+            <p>Since Maven 4.1.0, empty string plugin parameters have distinct 
semantics based on XML form:
+            <ul>
+            <li><b>Explicit empty tag</b> ({@code <param></param>}): overrides 
the mojo's pre-initialized
+                Java default with an empty value (empty string for {@code 
String}, {@code CharSequence},
+                {@code StringBuilder} and {@code StringBuffer} fields).</li>
+            <li><b>Self-closing tag</b> ({@code <param/>}): leaves the mojo's 
Java-initialized default
+                unchanged, i.e. is a no-op for that parameter.</li>
+            </ul>
+            <p>Note: for non-string scalar types (e.g. {@code int}, {@code 
boolean}), an empty element is
+            treated as absent and the Java-initialized default is always 
preserved.</p>

Review Comment:
   ⚠️ **Misleading scope (medium).** This documentation says "Since Maven 
4.1.0" without qualification, implying the behavior applies to all plugins. It 
does not — it only applies to **Maven 4 API plugins** using the `enhanced` 
configurator. Maven 3-style plugins use the `basic` configurator 
(`BasicComponentConfigurator` from sisu-plexus), which routes through 
`AbstractBasicConverter.fromExpression()` with the same `value == null || 
value.isEmpty()` skip-logic that this PR does NOT touch. As @gnodet noted in a 
review comment, the `basic` path is entirely unaffected by this fix.
   
   Documenting `<param></param>` vs `<param/>` as a universal Maven 4.1.0 
semantic without this caveat will mislead users whose plugins happen to use the 
`basic` configurator (which is still the default for the overwhelming majority 
of existing Maven plugins).
   
   Also: the first `<p>` tag (line 2592) is never closed before the `<ul>` on 
the next line — missing `</p>`.
   
   ```suggestion
               <p>Since Maven 4.1.0, empty string plugin parameters in <b>Maven 
4 API plugins</b>
               (those using the {@code enhanced} configurator) have distinct 
semantics based on XML form:
               </p>
               <ul>
               <li><b>Explicit empty tag</b> ({@code <param></param>}): 
overrides the mojo's pre-initialized
                   Java default with an empty value (empty string for {@code 
String}, {@code CharSequence},
                   {@code StringBuilder} and {@code StringBuffer} fields).</li>
               <li><b>Self-closing tag</b> ({@code <param/>}): leaves the 
mojo's Java-initialized default
                   unchanged, i.e. is a no-op for that parameter.</li>
               </ul>
   ```



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