apache / apache/maven

[MNG-6865] copy in object scope rather in class scope

Open
#8,436 3 comments 0 reactions 0 assignees View on GitHub
enhancement priority:minor
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
20h 42m
Merged PRs (30d)
297

Description

**[Arne Lewinski](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=oopexpert)** opened **[MNG-6865](https://issues.apache.org/jira/browse/MNG-6865?redirect=false)** and commented

This refactoring refers to a more intuitive API approach.

The interface "MavenExecutionRequest" should provide an object scope method to copy itself. This has to be implemented by each sub type of "MavenExecutionRequest". Neverteless: I only found the class "DefaultMavenExecutionRequest" implementing the interface.
1. Providing an object scope copy method makes the usage less verbose.
2. As the copy method is defined abstract: the MavenCli class got rid of the concrete class "DefaultMavenExecutionRequest" dependency

The static copy method should be declared deprecated and can be made private in the future.

---

**Remote Links:**
- [GitHub Pull Request #327
](https://github.com/apache/maven/pull/327)

Contributor guide

Open the contributing guide

Research direction

Start with the MavenExecutionRequest interface, its DefaultMavenExecutionRequest implementation, and MavenCli, as named in the issue. Review pull request #327 before making changes, since the refactoring work is already linked there. Done means the object-scope copy method is available on each subtype and the static method is deprecated.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.