From 5e7da1e89a9f20a4d20cb5643bf1c770eaf75f1d Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 19 Jul 2017 22:56:35 +0200 Subject: [PATCH] Alright then --- .../chat/formatting/ChatFormatterBuilder.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/buttondevteam/chat/formatting/ChatFormatterBuilder.java b/src/main/java/buttondevteam/chat/formatting/ChatFormatterBuilder.java index 1f2df12..d7a7726 100644 --- a/src/main/java/buttondevteam/chat/formatting/ChatFormatterBuilder.java +++ b/src/main/java/buttondevteam/chat/formatting/ChatFormatterBuilder.java @@ -26,12 +26,12 @@ public class ChatFormatterBuilder implements Serializable { short removecharcount = 0; boolean range = false; + /** + * The returned object is backed by this builder. All changes made to this object affets the returned one. + */ @SneakyThrows public ChatFormatter build() { - final ByteArrayOutputStream str = new ByteArrayOutputStream(); - new ObjectOutputStream(str).writeObject(this); - return new ChatFormatter( - (ChatFormatterBuilder) new ObjectInputStream(new ByteArrayInputStream(str.toByteArray())).readObject()); + return new ChatFormatter(this); } public Pattern getRegex() {