Escape vertical bar when splitting seed node addresses in command line

Otherwise it is interpreted as a special regular expression character and all
characters are splitted apart, causing a ``NullPointerException`` after
further splitting on ``:``.
This commit is contained in:
Ivan Vilata-i-Balaguer 2016-04-05 12:45:37 +02:00
parent 4c0cc738e4
commit 184fc55636

View file

@ -82,7 +82,7 @@ public class SeedNode {
String arg4 = args[4];
checkArgument(arg4.contains(":") && arg4.split(":").length > 1 && arg4.split(":")[1].length() > 3,
"Wrong program argument");
List<String> list = Arrays.asList(arg4.split("|"));
List<String> list = Arrays.asList(arg4.split("\\|"));
progArgSeedNodes = new HashSet<>();
list.forEach(e -> {
checkArgument(e.contains(":") && e.split(":").length == 2 && e.split(":")[1].length() == 4,