]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-926 increase performance of DefaultSensorContext#logWarning()
authorSimon Brandhof <simon.brandhof@gmail.com>
Mon, 27 Jan 2014 13:46:29 +0000 (14:46 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Mon, 27 Jan 2014 13:46:42 +0000 (14:46 +0100)
sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java

index 36e84cea339e921919b682487a0996641f438f89..be1cedaaf91ff0b2983c5af28fddce16c5eafa77 100644 (file)
@@ -94,8 +94,10 @@ public class DefaultSensorContext implements SensorContext {
   }
 
   private void logWarning() {
-    LOG.debug("Plugins are no more responsible for indexing physical resources like directories and files. This is now handled by the platform.", new SonarException(
-      "Plugin should not index physical resources"));
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("Plugins are no more responsible for indexing physical resources like directories and files. This is now handled by the platform.", new SonarException(
+        "Plugin should not index physical resources"));
+    }
   }
 
   @Override