Skip to content

Commit 2d91621

Browse files
PLUGINAPI-47 Add code variants to issues
1 parent 32af766 commit 2d91621

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/Issue.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,10 @@ interface Flow {
9898
* @since 9.13
9999
*/
100100
List<QuickFix> quickFixes();
101+
102+
/**
103+
* @since 9.17
104+
*/
105+
@CheckForNull
106+
List<String> codeVariants();
101107
}

plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/NewIssue.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,12 @@ enum FlowType {
133133
*/
134134
NewIssue setRuleDescriptionContextKey(@Nullable String ruleDescriptionContextKey);
135135

136+
/**
137+
* Registers a list of code variants for this issue.
138+
* In C and C++, it is commonplace to have multiple code variants. Two source codes are defined here as variants of each other if there
139+
* is any difference in their preprocessed source code.
140+
* @since 9.17
141+
*/
142+
NewIssue setCodeVariants(@Nullable Iterable<String> codeVariants);
143+
136144
}

plugin-api/src/main/java/org/sonar/api/issue/Issue.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,4 +255,10 @@ public interface Issue extends Serializable {
255255
* @since 5.1
256256
*/
257257
Collection<String> tags();
258+
259+
/**
260+
* @since 9.17
261+
*/
262+
@CheckForNull
263+
Collection<String> codeVariants();
258264
}

0 commit comments

Comments
 (0)