diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2015-04-08 08:59:36 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2015-04-08 09:00:00 +0200 |
commit | 7c50d3b8c30dfb6898ed66daee5b04954f9ab5fc (patch) | |
tree | d07ff199b62c635c6c690b17f0f3408f369137a9 /sonar-batch | |
parent | 58b02acb85b5dc2dfd60cbd4741d7ae8aa57afb2 (diff) | |
download | sonarqube-7c50d3b8c30dfb6898ed66daee5b04954f9ab5fc.tar.gz sonarqube-7c50d3b8c30dfb6898ed66daee5b04954f9ab5fc.zip |
Fix NPE: do not try to set lines on views technical projects
Diffstat (limited to 'sonar-batch')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/report/ComponentsPublisher.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/report/ComponentsPublisher.java b/sonar-batch/src/main/java/org/sonar/batch/report/ComponentsPublisher.java index fb20efee128..a683dafad81 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/report/ComponentsPublisher.java +++ b/sonar-batch/src/main/java/org/sonar/batch/report/ComponentsPublisher.java @@ -25,6 +25,7 @@ import org.sonar.api.batch.bootstrap.ProjectDefinition; import org.sonar.api.batch.bootstrap.ProjectReactor; import org.sonar.api.batch.fs.InputFile; import org.sonar.api.resources.Language; +import org.sonar.api.resources.Qualifiers; import org.sonar.api.resources.Resource; import org.sonar.api.resources.ResourceUtils; import org.sonar.batch.index.BatchResource; @@ -82,8 +83,8 @@ public class ComponentsPublisher implements ReportPublisherStep { if (sid != null) { builder.setSnapshotId(sid); } - if (ResourceUtils.isFile(r)) { - builder.setIsTest(ResourceUtils.isUnitTestClass(r)); + if (Qualifiers.isFile(r)) { + builder.setIsTest(ResourceUtils.isUnitTestFile(r)); builder.setLines(((InputFile) batchResource.inputPath()).lines()); } String name = getName(r); |