aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-svn-plugin
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2014-10-03 15:19:38 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2014-10-03 15:19:38 +0200
commit37dc7ea307e00451bdb09ffca55e97b9e1fe20ac (patch)
treeae70cd486751d9cc85bc455605c40cb97bd169dc /plugins/sonar-svn-plugin
parentd102a8a9916bac0ab600cd5e90ba5359766f8d6d (diff)
downloadsonarqube-37dc7ea307e00451bdb09ffca55e97b9e1fe20ac.tar.gz
sonarqube-37dc7ea307e00451bdb09ffca55e97b9e1fe20ac.zip
Fix some quality flaws
Diffstat (limited to 'plugins/sonar-svn-plugin')
-rw-r--r--plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnBlameCommand.java17
-rw-r--r--plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnBlameConsumer.java9
-rw-r--r--plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnPlugin.java2
3 files changed, 5 insertions, 23 deletions
diff --git a/plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnBlameCommand.java b/plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnBlameCommand.java
index 8f668141c76..4a9f2ba0e27 100644
--- a/plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnBlameCommand.java
+++ b/plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnBlameCommand.java
@@ -29,6 +29,7 @@ import org.sonar.api.batch.scm.BlameCommand;
import org.sonar.api.utils.command.Command;
import org.sonar.api.utils.command.CommandExecutor;
import org.sonar.api.utils.command.StreamConsumer;
+import org.sonar.api.utils.command.StringStreamConsumer;
import java.io.File;
import java.util.ArrayList;
@@ -133,20 +134,4 @@ public class SvnBlameCommand implements BlameCommand, BatchComponent {
}
return cl;
}
-
- private static class StringStreamConsumer implements StreamConsumer {
- private StringBuffer string = new StringBuffer();
-
- private String ls = System.getProperty("line.separator");
-
- @Override
- public void consumeLine(String line) {
- string.append(line + ls);
- }
-
- public String getOutput() {
- return string.toString();
- }
- }
-
}
diff --git a/plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnBlameConsumer.java b/plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnBlameConsumer.java
index b0ca1932fb2..05699981b63 100644
--- a/plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnBlameConsumer.java
+++ b/plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnBlameConsumer.java
@@ -93,14 +93,11 @@ public class SvnBlameConsumer implements StreamConsumer {
}
String lineNumberStr = matcher.group(1);
lineNumber = Integer.parseInt(lineNumberStr);
- }
- else if ((matcher = REVISION_PATTERN.matcher(line)).find()) {
+ } else if ((matcher = REVISION_PATTERN.matcher(line)).find()) {
revision = matcher.group(1);
- }
- else if ((matcher = AUTHOR_PATTERN.matcher(line)).find()) {
+ } else if ((matcher = AUTHOR_PATTERN.matcher(line)).find()) {
author = matcher.group(1);
- }
- else if ((matcher = DATE_PATTERN.matcher(line)).find()) {
+ } else if ((matcher = DATE_PATTERN.matcher(line)).find()) {
String date = matcher.group(1);
String time = matcher.group(2);
Date dateTime = parseDateTime(date + " " + time);
diff --git a/plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnPlugin.java b/plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnPlugin.java
index bf628688eb7..d8815d8dd60 100644
--- a/plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnPlugin.java
+++ b/plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnPlugin.java
@@ -28,7 +28,7 @@ import java.util.List;
public final class SvnPlugin extends SonarPlugin {
public List getExtensions() {
- ArrayList result = new ArrayList();
+ List result = new ArrayList();
result.addAll(ImmutableList.of(
SvnScmProvider.class,
SvnBlameCommand.class,