summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@oath.com>2018-02-06 13:12:25 +0100
committerHåkon Hallingstad <hakon@oath.com>2018-02-06 13:12:25 +0100
commitba9385ce2c55e68adb5e16c57603f5e018fada35 (patch)
treeb84b59118672e0ffed7102a3e89c337dd1f760c3
parentc1b9b80f7fc5d0181362f4684fcac7454368c040 (diff)
Remove unnecessary recursive guard
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/CommandResult.java9
1 files changed, 0 insertions, 9 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/CommandResult.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/CommandResult.java
index 9905509e2d5..e0e84242f78 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/CommandResult.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/CommandResult.java
@@ -20,8 +20,6 @@ public class CommandResult {
private final int exitCode;
private final String output;
- private boolean inMapFunction = false;
-
CommandResult(CommandLine commandLine, int exitCode, String output) {
this.commandLine = commandLine;
this.exitCode = exitCode;
@@ -62,17 +60,10 @@ public class CommandResult {
* This method is intended to be used as part of the verification of the output.
*/
public <R> R map(Function<CommandResult, R> mapper) {
- if (inMapFunction) {
- throw new IllegalStateException("map() cannot be called recursively");
- }
- inMapFunction = true;
-
try {
return mapper.apply(this);
} catch (RuntimeException e) {
throw new UnexpectedOutputException2(e, "Failed to map output", commandLine.toString(), output);
- } finally {
- inMapFunction = false;
}
}