From 69870060d45d5cdca064e67779dfc5619001ae42 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 2 Feb 2013 22:47:22 +0100 Subject: [PATCH] Copy options when rescuing Sone. --- src/main/java/net/pterodactylus/sone/core/Core.java | 1 + src/main/java/net/pterodactylus/sone/data/Sone.java | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 9fe41ac..0571e0d 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -1091,6 +1091,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, } } synchronized (sones) { + sone.setOptions(storedSone.get().getOptions()); sones.put(sone.getId(), sone); } } diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index 9d9d2d7..a609982 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -228,7 +228,7 @@ public class Sone implements Fingerprintable, Comparable { private final List albums = new CopyOnWriteArrayList(); /** Sone-specific options. */ - private final Options options = new Options(); + private Options options = new Options(); /** * Creates a new Sone. @@ -895,6 +895,17 @@ public class Sone implements Fingerprintable, Comparable { return options; } + /** + * Sets the options of this Sone. + * + * @param options + * The options of this Sone + */ + /* TODO - remove this method again, maybe add an option provider */ + public void setOptions(Options options) { + this.options = options; + } + // // FINGERPRINTABLE METHODS // -- 2.7.4