aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2014-07-07 16:28:58 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2014-07-07 16:29:24 +0200
commit6ace78128277d173c22a02518305838454bd95f8 (patch)
tree6e2b4568feb5a062fd86775899623235b7dbee46 /sonar-batch
parent2d8b6e295dd33f85a3eaa28c2798b720ca55f7ff (diff)
downloadsonarqube-6ace78128277d173c22a02518305838454bd95f8.tar.gz
sonarqube-6ace78128277d173c22a02518305838454bd95f8.zip
Improve filesystem logger
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileSystemLogger.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileSystemLogger.java b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileSystemLogger.java
index 3238b870e43..d715e31792f 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileSystemLogger.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileSystemLogger.java
@@ -20,6 +20,7 @@
package org.sonar.batch.scan.filesystem;
import com.google.common.annotations.VisibleForTesting;
+import org.codehaus.plexus.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonar.api.BatchComponent;
@@ -68,10 +69,12 @@ public class FileSystemLogger implements BatchComponent {
for (Iterator<File> it = paths.iterator(); it.hasNext();) {
File file = it.next();
String relativePathToBaseDir = resolver.relativePath(baseDir, file);
- if (relativePathToBaseDir != null) {
- sb.append(relativePathToBaseDir);
- } else {
+ if (relativePathToBaseDir == null) {
sb.append(file);
+ } else if (StringUtils.isBlank(relativePathToBaseDir)) {
+ sb.append(".");
+ } else {
+ sb.append(relativePathToBaseDir);
}
if (it.hasNext()) {
sb.append(", ");