Skip to content

Commit

Permalink
Wrong object synced
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Oct 23, 2016
1 parent bbc7701 commit 07d861a
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -148,13 +148,13 @@ public boolean sync(Object other, Object that) {
getAllFields(fieldsToProcess, that.getClass());

for(Field field : fieldsToProcess) {
syncField(other, field);
syncField(other, that, field);
}

return needsSaving();
}

private void syncField(Object other, Field field) {
private void syncField(Object other, Object that, Field field) {
try {
// don't sync transient fields
if(Modifier.isTransient(field.getModifiers())) {
Expand All @@ -167,7 +167,7 @@ private void syncField(Object other, Field field) {
field.setAccessible(true);
}

Object original = field.get(this);
Object original = field.get(that);
Object remote = field.get(other);

// is this a subclass that contains entries itself?
Expand All @@ -176,7 +176,7 @@ private void syncField(Object other, Field field) {
}
else {
if(!original.equals(remote)) {
field.set(this, remote);
field.set(that, remote);
setNeedsSaving();
}
}
Expand Down

0 comments on commit 07d861a

Please sign in to comment.