From: David ‘Bombe’ Roden Date: Fri, 1 Apr 2011 10:35:29 +0000 (+0200) Subject: Add synchronization. X-Git-Tag: 0.6^2~27 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=aca4e03f2e47ba62afa39f6ff04f7831dcfe0728;p=Sone.git Add synchronization. This has been noticed by FindBugs. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index a1aa6ee..e5695fa 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -397,8 +397,10 @@ public class Sone implements Fingerprintable, Comparable { * @return This Sone (for method chaining) */ public synchronized Sone setPosts(Collection posts) { - this.posts.clear(); - this.posts.addAll(posts); + synchronized (this) { + this.posts.clear(); + this.posts.addAll(posts); + } return this; }