diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2014-01-27 22:12:22 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2014-01-27 23:28:03 +0100 |
commit | 08977044fa003bd252310c62287642630ba02d09 (patch) | |
tree | 6493b4123a85d7d2f122b10404afdb5765431776 /sonar-plugin-api/src/main/java | |
parent | d4a2c2dcaaa12be21b264729144ae2484287b7c1 (diff) | |
download | sonarqube-08977044fa003bd252310c62287642630ba02d09.tar.gz sonarqube-08977044fa003bd252310c62287642630ba02d09.zip |
SONAR-926 add package-info.java to org.sonar.api.batch.coverage
Diffstat (limited to 'sonar-plugin-api/src/main/java')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/batch/coverage/CoberturaReportParser.java | 6 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/batch/coverage/package-info.java | 23 |
2 files changed, 27 insertions, 2 deletions
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<File> 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; |