* The updated Sone
*/
public void updateSone(Sone sone) {
- if (isRemoteSone(sone)) {
- Sone storedSone = getRemoteSone(sone.getId());
+ if (hasSone(sone.getId())) {
+ Sone storedSone = getSone(sone.getId());
if (!(sone.getTime() > storedSone.getTime())) {
logger.log(Level.FINE, "Downloaded Sone %s is not newer than stored Sone %s.", new Object[] { sone, storedSone });
return;
/* 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);