CR-6560 OPENDJ-1909: make diffEntries use delete+add
| | |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2011-2013 ForgeRock AS |
| | | * Portions copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.forgerock.opendj.ldap; |
| | |
| | | // and removed. We won't replace the attribute because this is |
| | | // not |
| | | // reversible. |
| | | final Attribute addedValues = new LinkedAttribute(ato); |
| | | addedValues.removeAll(afrom); |
| | | if (!addedValues.isEmpty()) { |
| | | request.addModification(new Modification(ModificationType.ADD, addedValues)); |
| | | } |
| | | |
| | | final Attribute deletedValues = new LinkedAttribute(afrom); |
| | | deletedValues.removeAll(ato); |
| | | if (!deletedValues.isEmpty()) { |
| | | request.addModification(new Modification(ModificationType.DELETE, deletedValues)); |
| | | } |
| | | |
| | | final Attribute addedValues = new LinkedAttribute(ato); |
| | | addedValues.removeAll(afrom); |
| | | if (!addedValues.isEmpty()) { |
| | | request.addModification(new Modification(ModificationType.ADD, addedValues)); |
| | | } |
| | | |
| | | afrom = ifrom.hasNext() ? ifrom.next() : null; |
| | | ato = ito.hasNext() ? ito.next() : null; |
| | | } else if (cmp < 0) { |
| | |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * * Portions copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.forgerock.opendj.ldap; |
| | |
| | | "bothDifferentAdds: toOnly1", |
| | | "bothDifferentAdds: toOnly2", |
| | | "-", |
| | | "add: bothDifferentAddsAndDeletes", |
| | | "bothDifferentAddsAndDeletes: toOnly", |
| | | "-", |
| | | "delete: bothDifferentAddsAndDeletes", |
| | | "bothDifferentAddsAndDeletes: fromOnly", |
| | | "-", |
| | | "add: bothDifferentAddsAndDeletes", |
| | | "bothDifferentAddsAndDeletes: toOnly", |
| | | "-", |
| | | "delete: bothDifferentDeletes", |
| | | "bothDifferentDeletes: fromOnly1", |
| | | "bothDifferentDeletes: fromOnly2", |
| | | "-", |
| | | "add: bothDifferentReplace", |
| | | "bothDifferentReplace: toOnly1", |
| | | "bothDifferentReplace: toOnly2", |
| | | "-", |
| | | "delete: bothDifferentReplace", |
| | | "bothDifferentReplace: fromOnly1", |
| | | "bothDifferentReplace: fromOnly2", |
| | | "-", |
| | | "add: bothDifferentReplace", |
| | | "bothDifferentReplace: toOnly1", |
| | | "bothDifferentReplace: toOnly2", |
| | | "-", |
| | | "delete: fromOnly", |
| | | "fromOnly: fromOnlyValue", |
| | | "-", |