From 08977044fa003bd252310c62287642630ba02d09 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 27 Jan 2014 22:12:22 +0100 Subject: SONAR-926 add package-info.java to org.sonar.api.batch.coverage --- .../api/batch/coverage/CoberturaReportParser.java | 6 ++++-- .../org/sonar/api/batch/coverage/package-info.java | 23 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/batch/coverage/package-info.java (limited to 'sonar-plugin-api/src/main/java') diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/coverage/CoberturaReportParser.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/coverage/CoberturaReportParser.java index a0cb0329b01..1da16286b99 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/coverage/CoberturaReportParser.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/coverage/CoberturaReportParser.java @@ -34,6 +34,7 @@ import org.sonar.api.scan.filesystem.ModuleFileSystem; import org.sonar.api.utils.StaxParser; import org.sonar.api.utils.XmlParserException; +import javax.annotation.CheckForNull; import javax.xml.stream.XMLStreamException; import java.io.File; @@ -51,7 +52,7 @@ import static org.sonar.api.utils.ParsingUtils.parseNumber; */ public class CoberturaReportParser implements BatchComponent { - private ModuleFileSystem fs; + private final ModuleFileSystem fs; public CoberturaReportParser(ModuleFileSystem fs) { this.fs = fs; @@ -78,7 +79,7 @@ public class CoberturaReportParser implements BatchComponent { }); parser.parse(xmlFile); } catch (XMLStreamException e) { - throw new XmlParserException(e); + throw new XmlParserException("Fail to parse " + xmlFile.getAbsolutePath(), e); } } @@ -113,6 +114,7 @@ public class CoberturaReportParser implements BatchComponent { } } + @CheckForNull private InputFile findInputFile(String filename, List sourceDirs) { for (File srcDir : sourceDirs) { File possibleFile = new File(srcDir, filename); diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/coverage/package-info.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/coverage/package-info.java new file mode 100644 index 00000000000..dd27e41d405 --- /dev/null +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/coverage/package-info.java @@ -0,0 +1,23 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2013 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +@ParametersAreNonnullByDefault +package org.sonar.api.batch.coverage; + +import javax.annotation.ParametersAreNonnullByDefault; -- cgit v1.2.3