arturobernalg commented on code in PR #2209:
URL: https://github.com/apache/maven-resolver/pull/2209#discussion_r4313621998
##########
maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultArtifactResolver.java:
##########
@@ -307,6 +307,20 @@ private List<ArtifactResult> resolve(
artifact = artifact.setVersion(versionResult.getVersion());
+ if (artifact.getVersion() == null
+ || artifact.getVersion().trim().isEmpty()) {
Review Comment:
You're right, and I was wrong to push back on this. `Artifact.getVersion()`
is documented as `@return The version, never {@code null}` and the interface
itself is `@noimplement` (clients are only supposed to extend
`AbstractArtifact`), so the `== null` branch really is unreachable per this
module's own API contract, not just for the concrete classes used here.
Simplified to just `artifact.getVersion().trim().isEmpty()`, pushed. Thanks for
catching it twice.
--
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]