Use 0-sized array in toArray

This commit is contained in:
Guillaume Nodet
2020-12-09 14:24:13 +01:00
parent 1534665e4f
commit 8eee89e189

View File

@@ -331,7 +331,7 @@ public enum Environment {
options.toArray(prefixes); options.toArray(prefixes);
prefixes[options.size()] = "-D" + property + "="; prefixes[options.size()] = "-D" + property + "=";
} else { } else {
prefixes = options.toArray(new String[options.size()]); prefixes = options.toArray(new String[0]);
} }
return args.stream().anyMatch(arg -> Stream.of(prefixes).anyMatch(arg::startsWith)); return args.stream().anyMatch(arg -> Stream.of(prefixes).anyMatch(arg::startsWith));
} }