Store a copy of the given profile.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 14 Oct 2010 06:25:17 +0000 (08:25 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 14 Oct 2010 06:25:17 +0000 (08:25 +0200)
src/main/java/net/pterodactylus/sone/data/Sone.java

index 62741e7..b70dbdb 100644 (file)
@@ -141,13 +141,15 @@ public class Sone {
        }
 
        /**
-        * Sets the profile of this Sone.
+        * Sets the profile of this Sone. A copy of the given profile is stored so
+        * that subsequent modifications of the given profile are not reflected in
+        * this Sone!
         *
         * @param profile
         *            The profile to set
         */
        public synchronized void setProfile(Profile profile) {
-               this.profile = profile;
+               this.profile = new Profile(profile);
                modificationCounter++;
        }