gnodet-bot commented on code in PR #13954:
URL: https://github.com/apache/maven/pull/13954#discussion_r4556596132
##########
api/maven-api-core/src/main/java/org/apache/maven/api/Artifact.java:
##########
@@ -188,19 +188,22 @@ default String getExtension() {
}
/**
- * Determines whether this artifact uses a snapshot version.
+ * Returns whether this artifact is a snapshot.
*
- * @return {@code true} if the artifact is a snapshot, {@code false}
otherwise
- * @see org.apache.maven.api.Session#isVersionSnapshot(String)
+ * @since 4.2.0
*/
- boolean isSnapshot();
+ boolean snapshot();
/**
- * {@return coordinates with the same identifiers as this artifact}.
- * This is a shortcut for {@code
session.createArtifactCoordinates(artifact)}.
- *
- * @see org.apache.maven.api.Session#createArtifactCoordinates(Artifact)
- */
- @Nonnull
- ArtifactCoordinates toCoordinates();
+ * Determines whether this artifact uses a snapshot version.
Review Comment:
🚨 **`toCoordinates()` was accidentally deleted.** This method is part of the
public `Artifact` API and is called in multiple places across the codebase
(e.g. `DefaultArtifactResolver`, `DefaultDependencyResolver`). Its removal is a
binary-incompatible breaking change.
The PR was only meant to add `boolean snapshot()` and deprecate
`isSnapshot()`. The `toCoordinates()` block was removed because the new
`isSnapshot()` deprecation body was placed where `toCoordinates()` used to be,
closing the interface without it.
Restore `toCoordinates()` after the new `isSnapshot()` block:
```java
/**
* {@return coordinates with the same identifiers as this artifact}.
* This is a shortcut for {@code
session.createArtifactCoordinates(artifact)}.
*
* @see org.apache.maven.api.Session#createArtifactCoordinates(Artifact)
*/
@Nonnull
ArtifactCoordinates toCoordinates();
```
--
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]