From 7c50d3b8c30dfb6898ed66daee5b04954f9ab5fc Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Wed, 8 Apr 2015 08:59:36 +0200 Subject: Fix NPE: do not try to set lines on views technical projects --- .../src/main/java/org/sonar/batch/report/ComponentsPublisher.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sonar-batch') 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); -- cgit v1.2.3