From 291e7c034f1d06938b02758d8cfbe8001900234b Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 18 Apr 2012 06:37:38 +0200 Subject: [PATCH] Use the first set value as original. --- .../java/net/pterodactylus/demoscenemusic/data/AbstractBase.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/AbstractBase.java b/src/main/java/net/pterodactylus/demoscenemusic/data/AbstractBase.java index 4a35db1..6a21081 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/AbstractBase.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/AbstractBase.java @@ -51,6 +51,8 @@ public class AbstractBase { private T original; + private boolean originalSet; + private T current; public T get() { @@ -58,6 +60,10 @@ public class AbstractBase { } public Value set(T value) { + if (!originalSet) { + original = value; + originalSet = true; + } current = value; return this; } -- 2.7.4