gnodet commented on code in PR #13036:
URL: https://github.com/apache/maven/pull/13036#discussion_r4047456639


##########
api/maven-api-core/src/main/java/org/apache/maven/api/Node.java:
##########
@@ -40,39 +40,98 @@
 @Provider
 public interface Node {
 
+    /**
+     * Returns the artifact for this node.
+     *
+     * @return artifact for this node, or {@code null} if none
+     */
+    @Nullable
+    Artifact artifact();
+
+    /**
+     * Returns the dependency for this node.
+     *
+     * @return dependency for this node, or {@code null} if none
+     */
+    @Nullable
+    Dependency dependency();
+
+    /**
+     * Gets the child nodes of this node.
+     *
+     * @return the child nodes of this node, never {@code null}
+     */
+    @Nonnull
+    List<Node> children();
+
+    /**
+     * Returns the remote repositories of this node.
+     *
+     * @return repositories of this node, never {@code null}
+     */
+    @Nonnull
+    List<RemoteRepository> remoteRepositories();
+
+    /**
+     * Returns the remote repository from which this artifact was downloaded, 
if known.
+     *
+     * @return an {@code Optional} containing the repository, or empty if not 
available (e.g. local artifact or root node)
+     */
+    @Nonnull
+    Optional<RemoteRepository> repository();
+
     /**
      * @return artifact for this node
+     * @deprecated Use {@link #artifact()} instead.
      */
     @Nullable
-    Artifact getArtifact();
+    @Deprecated(since = "4.1.0", forRemoval = true)
+    default Artifact getArtifact() {
+        return artifact();
+    }
 
     /**
      * @return dependency for this node
+     * @deprecated Use {@link #dependency()} instead.
      */
     @Nullable
-    Dependency getDependency();
+    @Deprecated(since = "4.1.0", forRemoval = true)
+    default Dependency getDependency() {
+        return dependency();
+    }
 
     /**
      * Gets the child nodes of this node.
      *
      * @return the child nodes of this node, never {@code null}
+     * @deprecated Use {@link #children()} instead.
      */
     @Nonnull
-    List<Node> getChildren();
+    @Deprecated(since = "4.1.0", forRemoval = true)
+    default List<Node> getChildren() {

Review Comment:
   Fixed in 9f4c9ab32a — all three `@Nonnull` wrappers (`getChildren`, 
`getRemoteRepositories`, `getRepository`) now have `@Deprecated` before 
`@Nonnull`. Also fixed `LocalRepository.getPath()` in the same commit.



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