aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-core-plugin/src
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2011-04-11 16:50:19 +0200
committerFabrice Bellingard <bellingard@gmail.com>2011-04-20 08:49:58 +0200
commit73a7647736e081c1d3840c423bd602e7301afe39 (patch)
treee8b1c22cd2a3d0a199dff23be92a2f7cc0cdf561 /plugins/sonar-core-plugin/src
parent142cc3422881e454de6eed0e27039f48cb653ba1 (diff)
downloadsonarqube-73a7647736e081c1d3840c423bd602e7301afe39.tar.gz
sonarqube-73a7647736e081c1d3840c423bd602e7301afe39.zip
Temporary commit before merging with Simon's modifications on
RuleFailure
Diffstat (limited to 'plugins/sonar-core-plugin/src')
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java1
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ReviewsDecorator.java46
2 files changed, 47 insertions, 0 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
index 37281c10c46..b0827f546f4 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
@@ -214,6 +214,7 @@ public class CorePlugin extends SonarPlugin {
extensions.add(NoSonarFilter.class);
extensions.add(DirectoriesDecorator.class);
extensions.add(FilesDecorator.class);
+ extensions.add(ReviewsDecorator.class);
// time machine
extensions.add(TendencyDecorator.class);
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ReviewsDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ReviewsDecorator.java
new file mode 100644
index 00000000000..040dc72dd72
--- /dev/null
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ReviewsDecorator.java
@@ -0,0 +1,46 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2008-2011 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar 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.
+ *
+ * Sonar 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 Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+package org.sonar.plugins.core.sensors;
+
+import org.sonar.api.batch.Decorator;
+import org.sonar.api.batch.DecoratorContext;
+import org.sonar.api.batch.DependedUpon;
+import org.sonar.api.resources.Project;
+import org.sonar.api.resources.Resource;
+
+/**
+ * Decorator that currently only closes a review when its corresponding violation has been fixed.
+ */
+@DependedUpon("ViolationPersisterDecorator")
+public class ReviewsDecorator implements Decorator {
+
+ public boolean shouldExecuteOnProject(Project project) {
+ return true;
+ }
+
+ public void decorate(Resource resource, DecoratorContext context) {
+ //
+ }
+
+ @Override
+ public String toString() {
+ return getClass().getSimpleName();
+ }
+}