Rename variable and don’t forget to increment counter.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 11 Nov 2010 05:33:25 +0000 (06:33 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 11 Nov 2010 05:33:25 +0000 (06:33 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java

index 450e996..616dd04 100644 (file)
@@ -857,8 +857,8 @@ public class Core implements IdentityListener {
 
                        /* save friends. */
                        int friendCounter = 0;
-                       for (String friend : sone.getFriends()) {
-                               configuration.getStringValue(sonePrefix + "/Friends/" + friendCounter + "/ID").setValue(friend);
+                       for (String friendId : sone.getFriends()) {
+                               configuration.getStringValue(sonePrefix + "/Friends/" + friendCounter++ + "/ID").setValue(friendId);
                        }
                        configuration.getStringValue(sonePrefix + "/Friends/" + friendCounter + "/ID").setValue(null);