Prevent Arrays#asList#remove call

Affects issues:
- Fixed #2096
This commit is contained in:
Risto Lahtela 2021-09-22 19:22:06 +03:00
parent b2b289617e
commit e762b8013f

View File

@ -119,9 +119,14 @@ public class PlanPlaceholderExtension extends PlaceholderExpansion {
} }
private List<String> parseParameters(String params) { private List<String> parseParameters(String params) {
List<String> parameters = Arrays.asList(params.split(":")); List<String> parameters = new ArrayList<>();
if (!parameters.isEmpty()) { boolean first = true;
parameters.remove(0); for (String parameter : params.split(":")) {
if (first) {
first = false;
} else {
parameters.add(parameter);
}
} }
return parameters; return parameters;
} }