[
https://issues.apache.org/jira/browse/MRESOLVER-445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17791626#comment-17791626
]
ASF GitHub Bot commented on MRESOLVER-445:
------------------------------------------
gnodet commented on PR #383:
URL: https://github.com/apache/maven-resolver/pull/383#issuecomment-1833775253
@cstamas have you looked at the possibility to add mutators that would
return a new `RepositorySession` instance instead of modifying the existing one
in-place. This would allow preserving the immutability, as this feels it goes
a bit backward...
If that does not work, it should be possible to implement a wrapper that
would simply delegate to a mutable field.
```
public class DefaultMutableSession implements MutableRepositorySession {
private RepositorySession session;
public DefaultMutableSession(RepositorySession session) {
this.session = session;
}
public void setCache(RepositoryCache cache) {
this.session = session.withCache(cache);
}
...
}
```
> Introduce MutableSession, a common ancestor for build and def impl
> ------------------------------------------------------------------
>
> Key: MRESOLVER-445
> URL: https://issues.apache.org/jira/browse/MRESOLVER-445
> Project: Maven Resolver
> Issue Type: Task
> Reporter: Tamas Cservenak
> Assignee: Tamas Cservenak
> Priority: Major
> Fix For: 2.0.0
>
>
> Reason is that this would simplify existing codebase upgrades, no need to
> maintain two execution paths.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)