From 3f8e45260624a3a751133a90e59ab1b382a3ea5b Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 27 Jan 2014 14:46:29 +0100 Subject: SONAR-926 increase performance of DefaultSensorContext#logWarning() --- sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sonar-batch/src/main/java') 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 36e84cea339..be1cedaaf91 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java +++ b/sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java @@ -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 -- cgit v1.2.3