aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2017-10-02 15:05:51 +0200
committerDuarte Meneses <duarte.meneses@sonarsource.com>2017-10-02 16:21:29 +0200
commita9d39cd9a107f66cfb2dc2555ad0f621aa50c306 (patch)
tree9d2eed311a0e7c4cf1daf92c47d23a2094f93ddd /sonar-scanner-engine
parent2510ba884971b7245445dac69641478a67bfad9d (diff)
downloadsonarqube-a9d39cd9a107f66cfb2dc2555ad0f621aa50c306.tar.gz
sonarqube-a9d39cd9a107f66cfb2dc2555ad0f621aa50c306.zip
SONAR-9816 Transitively find long-lived branch to use as target
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);
}