]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4715 Execute technical debt decorator only persistable resources
authorJulien Lancelot <julien.lancelot@gmail.com>
Mon, 30 Sep 2013 15:15:28 +0000 (17:15 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Mon, 30 Sep 2013 15:39:33 +0000 (17:39 +0200)
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/technicaldebt/TechnicalDebtDecorator.java
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/technicaldebt/TechnicalDebtModel.java

index c55d65f6edf3b452ca80e5864ccda1cf6f902550..0225e631e16d682dd11a51c185622a91a6ffaa6c 100644 (file)
@@ -59,7 +59,7 @@ public final class TechnicalDebtDecorator implements Decorator {
   }
 
   public void decorate(Resource resource, DecoratorContext context) {
-    if (!ResourceUtils.isUnitTestClass(resource)) {
+    if (ResourceUtils.isPersistable(resource) && !ResourceUtils.isUnitTestClass(resource)) {
       costCalculator.compute(context);
       saveCostMeasures(context);
     }
index 1cd1f33b63d67022efcc46b20763b374327c4509..570fc3f085f96a92d1b14fd5e53bc905e8b4d501 100644 (file)
@@ -45,7 +45,7 @@ public class TechnicalDebtModel implements BatchExtension {
   private Map<Rule, TechnicalDebtRequirement> requirementsByRule = Maps.newHashMap();
 
   public TechnicalDebtModel(ModelFinder modelFinder) {
-    TimeProfiler profiler = new TimeProfiler(LOGGER).start("TechnicalDebtModel");
+    TimeProfiler profiler = new TimeProfiler(LOGGER).start("Loading technical debt model");
     Model model = modelFinder.findByName(MODEL_NAME);
     if (model == null) {
       throw new SonarException("Can not find the model in database: " + MODEL_NAME);