From: Simon Brandhof Date: Mon, 24 Feb 2014 13:21:50 +0000 (+0100) Subject: Fix some quality flaws X-Git-Tag: 4.2~60 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=34cce8e330192c56a159a856ebd8072d38299087;p=sonarqube.git Fix some quality flaws --- diff --git a/sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java b/sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java index bbeb88afdb8..39b181710b2 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java +++ b/sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java @@ -207,6 +207,7 @@ public class DefaultSensorContext implements SensorContext { } public void saveSource(Resource reference, String source) { + // useless since 4.2. } public void saveLink(ProjectLink link) { diff --git a/sonar-batch/src/main/java/org/sonar/batch/index/Cache.java b/sonar-batch/src/main/java/org/sonar/batch/index/Cache.java index 37749efbeb7..792d273c162 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/index/Cache.java +++ b/sonar-batch/src/main/java/org/sonar/batch/index/Cache.java @@ -404,6 +404,7 @@ public class Cache { @Override public void remove() { + throw new UnsupportedOperationException("Removing an item is not supported"); } } @@ -529,7 +530,7 @@ public class Cache { @Override public void remove() { - // nothing to do + throw new UnsupportedOperationException("Removing an item is not supported"); } } diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/LanguageDetection.java b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/LanguageDetection.java index c34e0d42184..c6f6cc6b42a 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/LanguageDetection.java +++ b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/LanguageDetection.java @@ -109,7 +109,7 @@ class LanguageDetection { } } if (detectedLanguage != null) { - LOG.debug("Language of file '" + inputFile.relativePath() + "' was detected to be '" + detectedLanguage + "'"); + LOG.debug(String.format("Language of file '%s' is detected to be '%s'", inputFile.relativePath(), detectedLanguage)); return detectedLanguage; }