[ https://issues.apache.org/jira/browse/MRESOLVER-548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17840835#comment-17840835 ]
ASF GitHub Bot commented on MRESOLVER-548: ------------------------------------------ gnodet commented on code in PR #482: URL: https://github.com/apache/maven-resolver/pull/482#discussion_r1579622273 ########## maven-resolver-api/src/main/java/org/eclipse/aether/artifact/AbstractArtifact.java: ########## @@ -96,30 +96,40 @@ public Artifact setVersion(String version) { return newInstance(version, getProperties(), getPath()); } + @Deprecated + @Override + public Artifact setFile(File file) { + File current = getFile(); + if (Objects.equals(current, file)) { + return this; + } + return newInstance(getVersion(), getProperties(), file != null ? file.toPath() : null); + } + /** * This method should (and in Resolver is) overridden, but is kept just to preserve backward compatibility if * this class is extended somewhere. */ + @Override public Path getPath() { File file = getFile(); return file != null ? file.toPath() : null; } - @Deprecated - @Override - public Artifact setFile(File file) { - return setPath(file != null ? file.toPath() : null); - } - + /** + * This method should (and in Resolver is) overridden, but is kept just to preserve backward compatibility if + * this class is extended somewhere. + */ @Override public Artifact setPath(Path path) { Path current = getPath(); if (Objects.equals(current, path)) { return this; } - return newInstance(getVersion(), getProperties(), path); + return setFile(path != null ? path.toFile() : null); Review Comment: That's wrong. It goes out the NIO api which means a virtual FileSystem cannot be used anymore. > Artifact path/file improvements > ------------------------------- > > Key: MRESOLVER-548 > URL: https://issues.apache.org/jira/browse/MRESOLVER-548 > Project: Maven Resolver > Issue Type: Improvement > Components: Resolver > Reporter: Tamas Cservenak > Priority: Major > Fix For: 2.0.0, 2.0.0-alpha-11 > > -- This message was sent by Atlassian Jira (v8.20.10#820010)