From e9c69dc80c96dd5b560ca3f4cf43dd91c27db4de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Sun, 16 Feb 2020 14:49:47 +0100 Subject: [PATCH] Make ListFlag lists immutable --- .../plotsquared/plot/flags/types/ListFlag.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/types/ListFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/types/ListFlag.java index 2efb4b864..1a048fefb 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/types/ListFlag.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/types/ListFlag.java @@ -7,12 +7,13 @@ import com.github.intellectualsites.plotsquared.plot.util.StringMan; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; +import java.util.Collections; import java.util.List; public abstract class ListFlag, F>> extends PlotFlag, F> { public ListFlag(final List valueList, final Captions category, final Caption description) { - super(valueList, category, description); + super(Collections.unmodifiableList(valueList), category, description); } @Override public F merge(@NotNull List newValue) {