elharo commented on a change in pull request #10: fix a number of small
warnings and formatting issues
URL: https://github.com/apache/maven-shared-utils/pull/10#discussion_r383223309
##########
File path:
src/test/java/org/apache/maven/shared/utils/cli/CommandLineUtilsTest.java
##########
@@ -128,33 +127,37 @@ public void
givenASingleQuoteMarkInArgument_whenExecutingCode_thenExitCode0Retur
}
@Test
- public void
givenASingleQuoteMarkInArgument_whenTranslatingToCmdLineArgs_thenTheQuotationMarkIsNotEscaped()
throws Exception
+ public void
givenASingleQuoteMarkInArgument_whenTranslatingToCmdLineArgs_thenTheQuotationMarkIsNotEscaped()
+ throws Exception
{
final String command = "echo \"let's go\"";
- final String[] expected = new String[]{"echo", "let's go"};
- assertCmdLineArgs(expected, command);
+ final String[] expected = new String[] { "echo", "let's go" };
+ assertCmdLineArgs( expected, command );
}
@Test
- public void
givenAnEscapedDoubleQuoteMarkInArgument_whenTranslatingToCmdLineArgs_thenTheQuotationMarkRemainsEscaped()
throws Exception
+ public void
givenAnEscapedDoubleQuoteMarkInArgument_whenTranslatingToCmdLineArgs_thenTheQuotationMarkRemainsEscaped()
+ throws Exception
{
final String command = "echo \"let\\\"s go\"";
- final String[] expected = new String[]{"echo", "let\\\"s go"};
- assertCmdLineArgs(expected, command);
+ final String[] expected = new String[] { "echo", "let\\\"s go" };
+ assertCmdLineArgs( expected, command );
}
@Test
- public void
givenAnEscapedSingleQuoteMarkInArgument_whenTranslatingToCmdLineArgs_thenTheQuotationMarkRemainsEscaped()
throws Exception
+ public void
givenAnEscapedSingleQuoteMarkInArgument_whenTranslatingToCmdLineArgs_thenTheQuotationMarkRemainsEscaped()
+ throws Exception
{
final String command = "echo \"let\\\'s go\"";
- final String[] expected = new String[]{"echo", "let\\\'s go"};
- assertCmdLineArgs(expected, command);
+ final String[] expected = new String[] { "echo", "let\\\'s go" };
Review comment:
The world seems split on this one. I personally avoid final on local
variables except where it's required, mostly because that's my employer's
style; but in Maven I've been trying to leave `final` in place where it already
exists to avoid excess churn.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services