-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#2117] Refactor CliArguments
to conform to RepoConfiguration
's Builder Pattern
#2118
[#2117] Refactor CliArguments
to conform to RepoConfiguration
's Builder Pattern
#2118
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though I have a minor query.
@@ -508,7 +461,9 @@ public Builder reportConfiguration(ReportConfiguration reportConfiguration) { | |||
* @return CliArguments | |||
*/ | |||
public CliArguments build() { | |||
return new CliArguments(this); | |||
CliArguments built = this.cliArguments; | |||
this.cliArguments = new CliArguments(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I clarify why we choose to reset cliArguments
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! The main motivation behind resetting the Builder object on every build
operation is to prevent aliasing issues when the user chooses to rebuild CliArguments
multiple times. Since the cloning operation has not been implemented yet, we decided that the temporary fix would be to reset the Builder object on every build.
A new issue has been released which aims to tackle this issue and to allow duplication of CliArguments
to avoid resetting the Builder object on every build. I am working on it and will release the PR sometime this coming week!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, could you also link this PR in issue #2119
Sure thing, I have linked this issue within issue #2119! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for standardising the builders
The following links are for previewing this pull request:
|
Fixes #2117
Proposed commit message
Other information
N/A