gnodet-bot commented on code in PR #14067:
URL: https://github.com/apache/maven/pull/14067#discussion_r4616288572
##########
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()`. Re-raised from previous review —
not addressed by new commit.
```suggestion
* @return a {@code String}
* @since 4.2.0
*/
```
##########
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.0.0", forRemoval = true)
+ public String getNamespaceUri() {
Review Comment:
`@Deprecated(since = "4.0.0")` is wrong. `getNamespaceUri()` was the
**primary API** in Maven 4.0.0 — it is deprecated for the first time by this PR
targeting 4.2.0. Using `"4.0.0"` as the `since` value falsely implies the
method was already deprecated in a released version. Same issue applies to
`getModelEncoding()` and the generated `get${Cap}()` in the field loop below.
```suggestion
@Deprecated(since = "4.2.0", forRemoval = true)
```
##########
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}() {
return this.${field.name};
Review Comment:
The template-generated `${field.name}()` accessor is the new primary API for
all model fields. Its Javadoc block needs `@since 4.2.0`. Re-raised from
previous review — not addressed.
Add `@since 4.2.0` to the Javadoc block that precedes this method in the
template (after the `@return` line).
##########
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.0.0", forRemoval = true)
+ public String getNamespaceUri() {
+ return namespaceUri();
+ }
+
+ /**
+ * The encoding used for the model.
+ *
+ * @return a {@code String}
+ */
+ public String modelEncoding() {
return modelEncoding;
}
+ /**
+ * @deprecated Use {@link #modelEncoding()} instead.
+ */
+ @Deprecated(since = "4.0.0", forRemoval = true)
+ public String getModelEncoding() {
Review Comment:
Same `@Deprecated(since = "4.0.0")` issue — should be `"4.2.0"`.
```suggestion
@Deprecated(since = "4.2.0", forRemoval = true)
```
##########
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}() {
return this.${field.name};
}
+ /**
+ * @deprecated Use {@link #${field.name}()} instead.
+ */
+ @Deprecated(since = "4.0.0", forRemoval = true)
+ #if ( $field.type == "java.util.List" || $field.type ==
"java.util.Properties" )
Review Comment:
Same `@Deprecated(since = "4.0.0")` issue on the generated `get${Cap}()`
methods — should be `"4.2.0"`. This propagates to all generated model classes
(every field in every API module).
```suggestion
@Deprecated(since = "4.2.0", forRemoval = true)
```
##########
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.0.0", forRemoval = true)
+ public String getNamespaceUri() {
+ return namespaceUri();
+ }
+
+ /**
+ * The encoding used for the model.
+ *
+ * @return a {@code String}
+ */
Review Comment:
Missing `@since 4.2.0` on `modelEncoding()`. Re-raised from previous review
— not addressed.
```suggestion
* @return a {@code String}
* @since 4.2.0
*/
```
--
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]