elharo commented on code in PR #13348:
URL: https://github.com/apache/maven/pull/13348#discussion_r4323794267


##########
api/maven-api-model/src/main/mdo/maven.mdo:
##########
@@ -2589,6 +2589,13 @@
             <li>{@code combine.self}: available values are {@code merge} 
(default) and {@code override}.</li>
             </ul>
 
+            <p>In Maven 4+, empty string plugin parameters (whether specified 
as {@code <param></param>}
+            or {@code <param/>}) override the mojo's pre-initialized Java 
default with an empty value
+            (empty string for {@code String}, {@code CharSequence}, {@code 
StringBuilder} and
+            {@code StringBuffer} fields).</p>
+            <p>Note: for non-string scalar types (e.g. {@code int}, {@code 
boolean}), an empty element is

Review Comment:
   It seems confusing that we have this distinction between string and 
non-string types here. Why do we ever need or want to set a parameter to the 
empty string?
   
   If a default is available, I would think that the expectation is that there 
will always be a value. That is, the property cannot and should not be unset. 
And it seems weird that the value would literally be the empty string. Is there 
a case where this makes sense?



##########
impl/maven-core/src/main/java/org/apache/maven/configuration/internal/EnhancedCompositeBeanHelper.java:
##########
@@ -307,6 +316,35 @@ private void setFieldValue(Object bean, Field field, 
Object value) throws Illega
         field.set(bean, value);
     }
 
+    /**
+     * Fallback to provide an empty instance (e.g. empty String) for empty tags

Review Comment:
   technical point: empty tags --> empty elements
   
   There is no such thing as an empty tag.



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