gnodet-bot commented on code in PR #14067:
URL: https://github.com/apache/maven/pull/14067#discussion_r4616080892
##########
src/mdo/model.vm:
##########
@@ -204,14 +204,40 @@ public class ${class.name}
#end
#if ( $class == $root )
- public String getNamespaceUri() {
+ /**
+ * The namespace URI of the model.
+ *
+ * @return a {@code String}
+ */
+ public String namespaceUri() {
Review Comment:
Missing `@since 4.2.0` on `namespaceUri()`. This is a new public API method
(the primary accessor replacing the deprecated `getNamespaceUri()`), so it must
carry a `@since` tag indicating when it was introduced. Same applies to
`modelEncoding()` on line 229.
```suggestion
/**
* The namespace URI of the model.
*
* @return a {@code String}
* @since 4.2.0
*/
public String namespaceUri() {
```
##########
src/mdo/model.vm:
##########
@@ -204,14 +204,40 @@ public class ${class.name}
#end
#if ( $class == $root )
- public String getNamespaceUri() {
+ /**
+ * The namespace URI of the model.
+ *
+ * @return a {@code String}
+ */
+ public String namespaceUri() {
return namespaceUri;
}
- public String getModelEncoding() {
+ /**
+ * @deprecated Use {@link #namespaceUri()} instead.
+ */
+ @Deprecated(since = "4.2.0", forRemoval = true)
+ public String getNamespaceUri() {
+ return namespaceUri();
+ }
+
+ /**
+ * The encoding used for the model.
+ *
+ * @return a {@code String}
+ */
+ public String modelEncoding() {
Review Comment:
Same missing `@since 4.2.0` on `modelEncoding()`.
```suggestion
/**
* The encoding used for the model.
*
* @return a {@code String}
* @since 4.2.0
*/
public String modelEncoding() {
```
##########
src/mdo/model.vm:
##########
@@ -235,10 +261,21 @@ public class ${class.name}
#if ( $field.type == "java.util.List" || $field.type ==
"java.util.Properties" )
@Nonnull
#end
- public ${type} ${pfx}${cap}() {
+ public ${type} ${field.name}() {
Review Comment:
The template-generated field accessor `${field.name}()` has no Javadoc at
all — and therefore no `@since 4.2.0` tag. Since `${field.name}()` is the new
primary accessor (the old `${pfx}${cap}()` getter is now a deprecated
delegate), it needs both a Javadoc block and a `@since 4.2.0` tag.
This cannot be deferred to a follow-up — the tag is part of the generated
API contract and should land in the same PR that introduces the new accessors.
At minimum, the generated Javadoc should carry the existing field description
from the `.mdo` model and a `@since 4.2.0` tag. For example, within the
`#foreach` loop, before the `${field.name}()` accessor, generate:
```velocity
/**
* ${field.description}
*
* @return ${field.type}
* @since 4.2.0
*/
public ${type} ${field.name}() {
```
(exact Velocity expansion may need adjustment depending on what properties
are available on `$field`.)
--
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]