diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-10-09 11:36:31 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-10-09 11:37:09 +0200 |
commit | 1f2c767187d23d71f2af67a2c1686eb849f3c717 (patch) | |
tree | 832625cf4942eb7acc457bd3acbd9972fbc8c5f3 /sonar-batch | |
parent | 6ef2bdd53c9f2d82dc833935bdfa2c4e0722197f (diff) | |
download | sonarqube-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.java | 4 | ||||
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/design/SubProjectDsmDecorator.java | 5 |
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(); } } |