aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-cpd-plugin
diff options
context:
space:
mode:
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>2013-02-18 15:12:46 +0100
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>2013-02-18 15:12:46 +0100
commit6900f586ea8f30c0a5a35b299f7461bd1bc867ae (patch)
tree65d5ebfc69c4cf4f2497b808b60f3537536eabe6 /plugins/sonar-cpd-plugin
parent7a6cf980b64c18a921a42199c1ca81b3c724348f (diff)
downloadsonarqube-6900f586ea8f30c0a5a35b299f7461bd1bc867ae.tar.gz
sonarqube-6900f586ea8f30c0a5a35b299f7461bd1bc867ae.zip
SONAR-3108 Improve log to look like the main exclusions/inclusions
Diffstat (limited to 'plugins/sonar-cpd-plugin')
-rw-r--r--plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdEngine.java9
-rw-r--r--plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/SonarBridgeEngineTest.java6
2 files changed, 12 insertions, 3 deletions
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdEngine.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdEngine.java
index 0b5f03ad4a8..ed44e05f6c5 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdEngine.java
+++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdEngine.java
@@ -19,7 +19,6 @@
*/
package org.sonar.plugins.cpd;
-import com.google.common.base.Joiner;
import org.slf4j.Logger;
import org.sonar.api.BatchExtension;
import org.sonar.api.batch.SensorContext;
@@ -34,7 +33,13 @@ public abstract class CpdEngine implements BatchExtension {
protected void logExclusions(String[] exclusions, Logger logger) {
if (exclusions.length > 0) {
- logger.info("Exclusions applied to copy-paste detection: " + Joiner.on(",").join(exclusions));
+ StringBuilder message = new StringBuilder("Copy-paste detection exclusions:");
+ for (String exclusion : exclusions) {
+ message.append("\n ");
+ message.append(exclusion);
+ }
+
+ logger.info(message.toString());
}
}
diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/SonarBridgeEngineTest.java b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/SonarBridgeEngineTest.java
index a7cde907a0d..ee6874620c3 100644
--- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/SonarBridgeEngineTest.java
+++ b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/SonarBridgeEngineTest.java
@@ -55,7 +55,11 @@ public class SonarBridgeEngineTest {
logger = mock(Logger.class);
engine.logExclusions(new String[] {"Foo*", "**/Bar*"}, logger);
- verify(logger, times(1)).info("Exclusions applied to copy-paste detection: Foo*,**/Bar*");
+
+ String message = "Copy-paste detection exclusions:"
+ + "\n Foo*"
+ + "\n **/Bar*";
+ verify(logger, times(1)).info(message);
}
@Test