From 11d66bc58b9a5ebd94ee5220dcc5b5e610ad26bb Mon Sep 17 00:00:00 2001 From: makamys Date: Thu, 16 Feb 2023 05:23:58 +0100 Subject: [PATCH] Ensure PropertyToken#comment is mutable --- .../unimixins/common/AnnotatedProperties.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module-common/src/main/java/io/github/legacymoddingmc/unimixins/common/AnnotatedProperties.java b/module-common/src/main/java/io/github/legacymoddingmc/unimixins/common/AnnotatedProperties.java index 3426301..c1002bf 100644 --- a/module-common/src/main/java/io/github/legacymoddingmc/unimixins/common/AnnotatedProperties.java +++ b/module-common/src/main/java/io/github/legacymoddingmc/unimixins/common/AnnotatedProperties.java @@ -91,7 +91,7 @@ public class AnnotatedProperties { } else { prop = line; - PropertyToken token = new PropertyToken(new ArrayList<>(comment), prop); + PropertyToken token = new PropertyToken(comment, prop); tokens.put(token.key, token); comment.clear(); @@ -113,7 +113,7 @@ public class AnnotatedProperties { public String defaultValue; public PropertyToken(List comment, String propertyString) { - this.comment = comment; + this.comment = new ArrayList<>(comment); String[] pair = propertyString.split("="); if(pair.length != 2) { throw new RuntimeException(); @@ -124,7 +124,7 @@ public class AnnotatedProperties { } public PropertyToken(List comment, String key, String value) { - this.comment = comment; + this.comment = new ArrayList<>(comment); this.key = key; this.value = value; }