summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2020-02-01 00:10:34 +0100
committerGitHub <noreply@github.com>2020-02-01 00:10:34 +0100
commit83d98bab018975a05926b0d45a3ff1037c14039e (patch)
tree81f953f0e1faa456174991310d5c8141ad73511b /controller-api
parentde5f702fbbce8386b522d1afbc309a2621a387fd (diff)
Revert "Handle empty source revision"
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/SourceRevision.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/SourceRevision.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/SourceRevision.java
index 47538b4aaca..a9c1155c5ef 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/SourceRevision.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/SourceRevision.java
@@ -15,9 +15,12 @@ public class SourceRevision {
private final String commit;
public SourceRevision(String repository, String branch, String commit) {
- this.repository = nonBlank(repository, "repository cannot be null or empty");
- this.branch = nonBlank(branch, "branch cannot be null or empty");
- this.commit = nonBlank(commit, "commit cannot be null");
+ Objects.requireNonNull(repository, "repository cannot be null");
+ Objects.requireNonNull(branch, "branch cannot be null");
+ Objects.requireNonNull(commit, "commit cannot be null");
+ this.repository = repository;
+ this.branch = branch;
+ this.commit = commit;
}
public String repository() { return repository; }
@@ -42,11 +45,4 @@ public class SourceRevision {
public String toString() { return "source revision of repository '" + repository +
"', branch '" + branch + "' with commit '" + commit + "'"; }
-
- private static String nonBlank(String s, String message) {
- Objects.requireNonNull(message);
- if (s.isBlank()) throw new IllegalArgumentException(message);
- return s;
- }
-
}