From c35c6ba856dc4270e4c29233919c6bf5a06a648b Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Mon, 23 Sep 2013 17:26:16 +0200 Subject: SONAR-4689 Batch API to get issues of the current project --- .../java/org/sonar/api/issue/ModuleIssues.java | 41 ------------------- .../java/org/sonar/api/issue/ProjectIssues.java | 47 ++++++++++++++++++++++ 2 files changed, 47 insertions(+), 41 deletions(-) delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/issue/ModuleIssues.java create mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/issue/ProjectIssues.java (limited to 'sonar-plugin-api') diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/ModuleIssues.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/ModuleIssues.java deleted file mode 100644 index 2f1a974f51c..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/ModuleIssues.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ -package org.sonar.api.issue; - -import org.sonar.api.BatchComponent; - -/** - * Used by batch components to get the issues of the current module. It does not allow - * to get issues of all project modules. - * - * @since 4.0 - */ -public interface ModuleIssues extends BatchComponent { - - /** - * All the unresolved issues of the current module, including the issues reported by end-users. - */ - Iterable issues(); - - /** - * All the issues of this module that have been marked as resolved during this scan - */ - Iterable resolvedIssues(); -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/ProjectIssues.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/ProjectIssues.java new file mode 100644 index 00000000000..36659896d68 --- /dev/null +++ b/sonar-plugin-api/src/main/java/org/sonar/api/issue/ProjectIssues.java @@ -0,0 +1,47 @@ +/* + * 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. + */ +package org.sonar.api.issue; + +import org.sonar.api.BatchComponent; +import org.sonar.api.batch.InstantiationStrategy; +import org.sonar.api.batch.PostJob; + +import static org.sonar.api.batch.InstantiationStrategy.PER_BATCH; + +/** + * Used by batch components to get the issues of the project. You have to wait for all + * issues to have been computed (for example in a {@link PostJob}) to be sure all issues have + * been computed. + * + * @since 4.0 + */ +@InstantiationStrategy(PER_BATCH) +public interface ProjectIssues extends BatchComponent { + + /** + * All the unresolved issues of the project, including the issues reported by end-users. + */ + Iterable issues(); + + /** + * All the issues of this project that have been marked as resolved during this scan + */ + Iterable resolvedIssues(); +} -- cgit v1.2.3