Mercurial > hg > Database > Alice
changeset 579:56e2397e6c78 dispose
change TopologyNodeConfig
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 17 Dec 2015 21:22:50 +0900 |
parents | ffa43f252492 |
children | 4d013f75c2da |
files | src/main/java/alice/topology/node/TopologyNodeConfig.java |
diffstat | 1 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/alice/topology/node/TopologyNodeConfig.java Thu Dec 17 15:57:04 2015 +0900 +++ b/src/main/java/alice/topology/node/TopologyNodeConfig.java Thu Dec 17 21:22:50 2015 +0900 @@ -29,25 +29,24 @@ LinkedList<TopologyNodeConfig> configList = new LinkedList<TopologyNodeConfig>(); LinkedList<String> nodeConfigArgs = new LinkedList<String>(); - for(int i = 0; i < args.length; ++i) { - if("-host".equals(args[i])) { - if(!nodeConfigArgs.isEmpty()){ - configList.add(new TopologyNodeConfig((String[]) nodeConfigArgs.toArray())); + for(int i = 0; i < args.length; ++i) + if ("-host".equals(args[i])) { + if (!nodeConfigArgs.isEmpty()) { + configList.add(new TopologyNodeConfig(nodeConfigArgs.toArray(new String[] {}))); nodeConfigArgs = new LinkedList<String>(); } ++i; nodeConfigArgs.add("-host"); nodeConfigArgs.add(args[i]); - } else if("-port".equals(args[i])) { + } else if ("-port".equals(args[i])) { ++i; nodeConfigArgs.add("-port"); nodeConfigArgs.add(args[i]); - } else if("-cookie".equals(args[i])) { + } else if ("-cookie".equals(args[i])) { ++i; nodeConfigArgs.add("-cookie"); nodeConfigArgs.add(args[i]); } - } configList.add(new TopologyNodeConfig(nodeConfigArgs.toArray(new String[] {})));