You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2022/02/28 22:47:00 UTC

[jira] [Commented] (MSHARED-1041) Refactor: remove duplicate code, use addArg internally

    [ https://issues.apache.org/jira/browse/MSHARED-1041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17499210#comment-17499210 ] 

Michael Osipov commented on MSHARED-1041:
-----------------------------------------

Fantastic, you read my mind. Though consider that your sample code is wrong. You need to check the arg for true.

> Refactor: remove duplicate code, use addArg internally
> ------------------------------------------------------
>
>                 Key: MSHARED-1041
>                 URL: https://issues.apache.org/jira/browse/MSHARED-1041
>             Project: Maven Shared Components
>          Issue Type: Task
>          Components: maven-invoker
>            Reporter: Slawomir Jaranowski
>            Priority: Major
>
> We can replace methods like:
> {code}
> public InvocationRequest setDebug( boolean debug )
> {
>       this.debug = debug;
>       return this;
> }
> {code}
> by
> {code}
> public InvocationRequest setDebug( boolean debug )
> {
>       addArg( "-X" );
>       return this;
> } 
> {code}
> and simplify {{MavenCommandLineBuilder}}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)