asfgit closed pull request #83: sonar: Use "Arrays.toString(array)" instead
URL: https://github.com/apache/maven-scm/pull/83
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/blame/IntegrityBlameCommand.java
b/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/blame/IntegrityBlameCommand.java
index 21a7255f4..b5da8664c 100644
---
a/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/blame/IntegrityBlameCommand.java
+++
b/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/blame/IntegrityBlameCommand.java
@@ -123,21 +123,22 @@ private BlameScmResult doShellAnnotate(
IntegrityScmProviderRepository iRepo, Sc
shell.createArg().setValue( "--fields=date,revision,author" );
shell.createArg().setValue( '"' + filename + '"' );
IntegrityBlameConsumer shellConsumer = new IntegrityBlameConsumer(
getLogger() );
+ String commandLine = CommandLineUtils.toString( shell.getCommandline()
);
try
{
- getLogger().debug( "Executing: " + CommandLineUtils.toString(
shell.getCommandline() ) );
+ getLogger().debug( "Executing: " + commandLine );
int exitCode = CommandLineUtils.executeCommandLine( shell,
shellConsumer,
new
CommandLineUtils.StringStreamConsumer() );
boolean success = ( exitCode == 0 ? true : false );
ScmResult scmResult =
- new ScmResult( shell.getCommandline().toString(), "", "Exit
Code: " + exitCode, success );
+ new ScmResult( commandLine, "", "Exit Code: " + exitCode,
success );
return new BlameScmResult( shellConsumer.getBlameList(), scmResult
);
}
catch ( CommandLineException cle )
{
getLogger().error( "Command Line Exception: " + cle.getMessage() );
- result = new BlameScmResult( shell.getCommandline().toString(),
cle.getMessage(), "", false );
+ result = new BlameScmResult( commandLine, cle.getMessage(), "",
false );
}
return result;
diff --git
a/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/diff/IntegrityDiffCommand.java
b/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/diff/IntegrityDiffCommand.java
index c13e00488..75be50063 100644
---
a/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/diff/IntegrityDiffCommand.java
+++
b/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/diff/IntegrityDiffCommand.java
@@ -75,15 +75,15 @@ public DiffScmResult executeDiffCommand(
ScmProviderRepository repository, ScmFi
shell.createArg().setValue( "--filter=changed:all" );
shell.createArg().setValue( "--filter=format:text" );
IntegrityDiffConsumer shellConsumer = new IntegrityDiffConsumer(
getLogger() );
+ String commandLine = CommandLineUtils.toString( shell.getCommandline()
);
try
{
- getLogger().debug( "Executing: " + shell.getCommandline() );
+ getLogger().debug( "Executing: " + commandLine );
int exitCode = CommandLineUtils.executeCommandLine( shell,
shellConsumer,
new
CommandLineUtils.StringStreamConsumer() );
boolean success = ( exitCode == 128 ? false : true );
- ScmResult scmResult =
- new ScmResult( shell.getCommandline().toString(), "", "Exit
Code: " + exitCode, success );
+ ScmResult scmResult = new ScmResult( commandLine, "", "Exit Code:
" + exitCode, success );
// Since we can't really parse the differences output, we'll just
have to go by the command output
// Returning a DiffScmResult(List changedFiles, Map differences,
String patch, ScmResult result) to avoid
// a NPE in
org.codehaus.plexus.util.FileUtils.fileWrite(FileUtils.java:426)
@@ -93,7 +93,7 @@ public DiffScmResult executeDiffCommand(
ScmProviderRepository repository, ScmFi
catch ( CommandLineException cle )
{
getLogger().error( "Command Line Exception: " + cle.getMessage() );
- result = new DiffScmResult( shell.getCommandline().toString(),
cle.getMessage(), "", false );
+ result = new DiffScmResult( commandLine, cle.getMessage(), "",
false );
}
return result;
diff --git
a/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/fileinfo/IntegrityFileInfoCommand.java
b/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/fileinfo/IntegrityFileInfoCommand.java
index 9c31a2041..a819536c1 100644
---
a/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/fileinfo/IntegrityFileInfoCommand.java
+++
b/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/fileinfo/IntegrityFileInfoCommand.java
@@ -74,20 +74,21 @@ public ScmResult executeFileInfoCommand(
ScmProviderRepository repository, File
shell.createArg().setValue( "--user=" + api.getUserName() );
shell.createArg().setValue( '"' + filename + '"' );
IntegrityFileInfoConsumer shellConsumer = new
IntegrityFileInfoConsumer( getLogger() );
+ String commandLine = CommandLineUtils.toString( shell.getCommandline()
);
try
{
- getLogger().debug( "Executing: " + shell.getCommandline() );
+ getLogger().debug( "Executing: " + commandLine );
int exitCode = CommandLineUtils.executeCommandLine( shell,
shellConsumer,
new
CommandLineUtils.StringStreamConsumer() );
boolean success = ( exitCode == 128 ? false : true );
- result = new ScmResult( shell.getCommandline().toString(), "",
"Exit Code: " + exitCode, success );
+ result = new ScmResult( commandLine, "", "Exit Code: " + exitCode,
success );
}
catch ( CommandLineException cle )
{
getLogger().error( "Command Line Exception: " + cle.getMessage() );
- result = new ScmResult( shell.getCommandline().toString(),
cle.getMessage(), "", false );
+ result = new ScmResult( commandLine, cle.getMessage(), "", false );
}
return result;
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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