aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2014-10-09 11:36:31 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2014-10-09 11:37:09 +0200
commit1f2c767187d23d71f2af67a2c1686eb849f3c717 (patch)
tree832625cf4942eb7acc457bd3acbd9972fbc8c5f3 /sonar-batch
parent6ef2bdd53c9f2d82dc833935bdfa2c4e0722197f (diff)
downloadsonarqube-1f2c767187d23d71f2af67a2c1686eb849f3c717.tar.gz
sonarqube-1f2c767187d23d71f2af67a2c1686eb849f3c717.zip
SONAR-5672 Fix regression on views
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/design/ProjectDsmDecorator.java4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/design/SubProjectDsmDecorator.java5
2 files changed, 7 insertions, 2 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/design/ProjectDsmDecorator.java b/sonar-batch/src/main/java/org/sonar/batch/design/ProjectDsmDecorator.java
index 03a74c830af..c030e586a50 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/design/ProjectDsmDecorator.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/design/ProjectDsmDecorator.java
@@ -101,6 +101,8 @@ public class ProjectDsmDecorator implements Decorator {
}
private boolean shouldDecorateResource(Resource resource, DecoratorContext context) {
- return ResourceUtils.isProject(resource) && !((Project) resource).getModules().isEmpty();
+ // Should not execute on views
+ return (ResourceUtils.isRootProject(resource) || ResourceUtils.isModuleProject(resource))
+ && !((Project) resource).getModules().isEmpty();
}
}
diff --git a/sonar-batch/src/main/java/org/sonar/batch/design/SubProjectDsmDecorator.java b/sonar-batch/src/main/java/org/sonar/batch/design/SubProjectDsmDecorator.java
index b0556819c1d..d58012869c7 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/design/SubProjectDsmDecorator.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/design/SubProjectDsmDecorator.java
@@ -118,6 +118,9 @@ public class SubProjectDsmDecorator implements Decorator {
}
private boolean shouldDecorateResource(Resource resource, DecoratorContext context) {
- return ResourceUtils.isProject(resource) && ((Project) resource).getModules().isEmpty();
+ // Should not execute on views
+ return (ResourceUtils.isRootProject(resource) || ResourceUtils.isModuleProject(resource))
+ // Only on leaf projects
+ && ((Project) resource).getModules().isEmpty();
}
}