aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-12-27 10:06:40 +0100
committerJanos Gyerik <janos.gyerik@sonarsource.com>2018-01-05 15:49:51 +0100
commit0a5f93d23a7e8f419008a4408f99d169f40cf288 (patch)
treebfa8245478b210ceb0b76ca4eb0c465856b5ae10
parent29d4fd9afc740dd92e9b3223270ae5a3b48040de (diff)
downloadsonarqube-0a5f93d23a7e8f419008a4408f99d169f40cf288.tar.gz
sonarqube-0a5f93d23a7e8f419008a4408f99d169f40cf288.zip
SONAR-10085 backward runtime compatibility of QGChangeEventListener
so that sonar-branch plugin implementing previous version of QGChangeEventListener can run on this new version of SonarQube
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/qualitygate/changeevent/QGChangeEventListener.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualitygate/changeevent/QGChangeEventListener.java b/server/sonar-server/src/main/java/org/sonar/server/qualitygate/changeevent/QGChangeEventListener.java
index 8a525d672ad..efaa0d4589c 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualitygate/changeevent/QGChangeEventListener.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualitygate/changeevent/QGChangeEventListener.java
@@ -19,10 +19,21 @@
*/
package org.sonar.server.qualitygate.changeevent;
+import java.util.Collection;
+import java.util.Collections;
import java.util.Set;
import org.sonar.api.rules.RuleType;
public interface QGChangeEventListener {
+ /**
+ * @deprecated use {{@link #onIssueChanges(QGChangeEvent, Set)}} instead
+ */
+ // TODO remove this method and turn default method #onIssueChanges(QGChangeEvent, Set) into an interface method when
+ // support for #onIssueChanges(QGChangeEvent, Set) have been merged into sonar-branch's master
+ @Deprecated
+ default void onChanges(Trigger trigger, Collection<QGChangeEvent> changeEvents) {
+ // do nothing
+ }
/**
* Called consequently to a change done on one or more issue of a given project.
@@ -30,7 +41,9 @@ public interface QGChangeEventListener {
* @param qualityGateEvent can not be {@code null}
* @param changedIssues can not be {@code null} nor empty
*/
- void onIssueChanges(QGChangeEvent qualityGateEvent, Set<ChangedIssue> changedIssues);
+ default void onIssueChanges(QGChangeEvent qualityGateEvent, Set<ChangedIssue> changedIssues) {
+ onChanges(Trigger.ISSUE_CHANGE, Collections.singleton(qualityGateEvent));
+ }
interface ChangedIssue {
String getKey();