aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-scanner-engine')
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/BranchInfo.java12
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/ProjectBranches.java2
2 files changed, 13 insertions, 1 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/BranchInfo.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/BranchInfo.java
index 508d8d1ddfe..3031ffd65d3 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/BranchInfo.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/BranchInfo.java
@@ -19,6 +19,8 @@
*/
package org.sonar.scanner.scan.branch;
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
/**
@@ -29,11 +31,19 @@ public class BranchInfo {
private final String name;
private final BranchType type;
private final boolean isMain;
+ @Nullable
+ private final String branchTargetName;
- public BranchInfo(String name, BranchType type, boolean isMain) {
+ public BranchInfo(String name, BranchType type, boolean isMain, @Nullable String branchTargetName) {
this.name = name;
this.type = type;
this.isMain = isMain;
+ this.branchTargetName = branchTargetName;
+ }
+
+ @CheckForNull
+ public String branchTargetName() {
+ return branchTargetName;
}
public String name() {
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/ProjectBranches.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/ProjectBranches.java
index 697ab5dbaf4..00cd3965ec0 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/ProjectBranches.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/ProjectBranches.java
@@ -23,6 +23,7 @@ import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
+import javax.annotation.CheckForNull;
import javax.annotation.concurrent.Immutable;
/**
@@ -37,6 +38,7 @@ public class ProjectBranches {
branches = branchInfos.stream().collect(Collectors.toMap(BranchInfo::name, Function.identity()));
}
+ @CheckForNull
public BranchInfo get(String name) {
return branches.get(name);
}