From 34cce8e330192c56a159a856ebd8072d38299087 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 24 Feb 2014 14:21:50 +0100 Subject: [PATCH] Fix some quality flaws --- .../src/main/java/org/sonar/batch/DefaultSensorContext.java | 1 + sonar-batch/src/main/java/org/sonar/batch/index/Cache.java | 3 ++- .../org/sonar/batch/scan/filesystem/LanguageDetection.java | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) 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; } -- 2.39.5