From 8eaf237a2710f7e9a76b3214fcae902e7dcc4a22 Mon Sep 17 00:00:00 2001 From: filipesoliveira Date: Thu, 6 Aug 2020 11:15:19 +0100 Subject: [PATCH] Refactored the previous bug fix to minimize duplication by reusing an existing function. Bear in mind that the condition in the previous code was (config == null) and now is (config == null || config.equals("")). --- node/capsule/src/main/java/CordaCaplet.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/node/capsule/src/main/java/CordaCaplet.java b/node/capsule/src/main/java/CordaCaplet.java index be7529a113..a2c73e0dd3 100644 --- a/node/capsule/src/main/java/CordaCaplet.java +++ b/node/capsule/src/main/java/CordaCaplet.java @@ -33,9 +33,8 @@ public class CordaCaplet extends Capsule { private Config parseConfigFile(List args) { this.baseDir = getBaseDirectory(args); - String config = getOptionMultiple(args, Arrays.asList("--config-file", "-f")); - File configFile = (config == null) ? new File(baseDir, "node.conf") : new File(config); + File configFile = getConfigFile(args, baseDir); try { ConfigParseOptions parseOptions = ConfigParseOptions.defaults().setAllowMissing(false); Config defaultConfig = ConfigFactory.parseResources("corda-reference.conf", parseOptions);