Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/Checkpoints.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/Checkpoints.java (revision 1767703) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/Checkpoints.java (working copy) @@ -217,7 +217,6 @@ private void createIfNotExist() { if (store.find(Collection.SETTINGS, ID) == null) { UpdateOp updateOp = new UpdateOp(ID, true); - updateOp.set(Document.ID, ID); store.createOrUpdate(Collection.SETTINGS, updateOp); } } Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java (revision 1767703) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java (working copy) @@ -445,7 +445,6 @@ ClusterNodeInfo clusterNode = createInstance(store, machineId, instanceId, configuredClusterId, i == 0); String key = String.valueOf(clusterNode.id); UpdateOp update = new UpdateOp(key, true); - update.set(ID, key); update.set(MACHINE_ID_KEY, clusterNode.machineId); update.set(INSTANCE_ID_KEY, clusterNode.instanceId); if (updateLease) { Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterViewDocument.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterViewDocument.java (revision 1767703) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterViewDocument.java (working copy) @@ -215,9 +215,6 @@ // tries to create this first one simultaneously - so we use // 'create' - // going via 'create' requires ID to be set again (not only in new - // UpdateOp(id,isNew)): - updateOp.set(Document.ID, CLUSTERVIEW_DOC_ID); ArrayList updateOps = new ArrayList(); newViewSeqNum = 1L; updateOp.setNew(true); // paranoia as that's already set above Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java (revision 1767703) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java (working copy) @@ -390,7 +390,6 @@ UpdateOp asOperation(@Nonnull Revision revision) { String id = Utils.getIdFromPath(path); UpdateOp op = new UpdateOp(id, true); - op.set(Document.ID, id); if (Utils.isLongPath(path)) { op.set(NodeDocument.PATH, path); } Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalEntry.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalEntry.java (revision 1767703) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalEntry.java (working copy) @@ -295,7 +295,6 @@ UpdateOp asUpdateOp(@Nonnull Revision revision) { String id = asId(revision); UpdateOp op = new UpdateOp(id, true); - op.set(ID, id); op.set(CHANGES, getChanges().serialize()); // OAK-3085 : introduce a timestamp property // for later being used by OAK-3001 Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalGarbageCollector.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalGarbageCollector.java (revision 1767703) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalGarbageCollector.java (working copy) @@ -164,7 +164,6 @@ private void updateTailTimestamp(long gcOlderThan) { UpdateOp op = new UpdateOp(JOURNAL_GC_ID, true); - op.set(Document.ID, JOURNAL_GC_ID); op.max(TAIL_TIMESTAMP, gcOlderThan); ns.getDocumentStore().createOrUpdate(SETTINGS, op); } Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/SplitOperations.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/SplitOperations.java (revision 1767703) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/SplitOperations.java (working copy) @@ -310,7 +310,6 @@ String prevPath = Utils.getPreviousPathFor(path, h, entry.getKey() + 1); String prevId = Utils.getIdFromPath(prevPath); UpdateOp intermediate = new UpdateOp(prevId, true); - intermediate.set(Document.ID, prevId); if (Utils.isLongPath(prevPath)) { intermediate.set(NodeDocument.PATH, prevPath); } @@ -347,7 +346,6 @@ setPrevious(main, new Range(high, low, 0)); String oldPath = Utils.getPreviousPathFor(path, high, 0); UpdateOp old = new UpdateOp(Utils.getIdFromPath(oldPath), true); - old.set(Document.ID, old.getId()); if (Utils.isLongPath(oldPath)) { old.set(NodeDocument.PATH, oldPath); } Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/UpdateOp.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/UpdateOp.java (revision 1767703) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/UpdateOp.java (working copy) @@ -194,16 +194,13 @@ /** * Set the property to the given String value. *

- * Note that {@link Document#ID} does not need to be set using this method; + * Note that {@link Document#ID} must not be set using this method; * it is sufficiently specified by the id parameter set in the constructor. * * @param property the property name * @param value the value * @throws IllegalArgumentException - * if an attempt is made to set {@link Document#ID} to a value - * inconsistent with the id parameter set in the constructor - * (note that setting the ID here is redundant and might be - * rejected in future versions) + * if an attempt is made to set {@link Document#ID}. */ public void set(String property, String value) { internalSet(property, value); @@ -348,9 +345,9 @@ } private void internalSet(String property, Object value) { - if (Document.ID.equals(property) && !id.equals(value.toString())) { + if (Document.ID.equals(property)) { throw new IllegalArgumentException( - "updateOp.id (" + id + ") and set operation on " + Document.ID + " (" + value + ") disagree"); + "updateOp.id (" + id + ") must not set " + Document.ID); } Operation op = new Operation(Operation.Type.SET, value); changes.put(new Key(property, null), op); Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java (revision 1767703) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java (working copy) @@ -1523,11 +1523,6 @@ // other updates for (Entry entry : updateOp.getChanges().entrySet()) { Key k = entry.getKey(); - if (!includeId && k.getName().equals(Document.ID)) { - // TODO: remove once set _id is prohibited (OAK-4952) - // avoid exception "Mod on _id not allowed" - continue; - } Operation op = entry.getValue(); switch (op.type) { case SET: Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java (working copy) @@ -64,7 +64,6 @@ // add UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); assertTrue(super.ds.create(Collection.NODES, Collections.singletonList(up))); super.ds.invalidateCache(); assertNotNull(super.ds.find(Collection.NODES, id)); @@ -90,15 +89,13 @@ } @Test - public void testConflictingId() { - String id = this.getClass().getName() + ".testConflictingId"; + public void testSetId() { + String id = this.getClass().getName() + ".testSetId"; UpdateOp up = new UpdateOp(id, true); try { - up.set("_id", id + "x"); + up.set("_id", id); } catch (IllegalArgumentException expected) { - } finally { - removeMe.add(id); } } @@ -114,12 +111,10 @@ // create UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); assertNull(super.ds.createOrUpdate(Collection.NODES, up)); // update up = new UpdateOp(id, true); - up.set("_id", id); assertNotNull(super.ds.createOrUpdate(Collection.NODES, up)); removeMe.add(id); } @@ -157,7 +152,6 @@ // add UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); assertTrue(super.ds.create(Collection.JOURNAL, Collections.singletonList(up))); } @@ -179,7 +173,6 @@ // add UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set(existingProp, "lock"); up.setMapEntry(existingRevisionProp, r, "lock"); assertTrue(super.ds.create(Collection.NODES, Collections.singletonList(up))); @@ -186,79 +179,66 @@ // updates up = new UpdateOp(id, false); - up.set("_id", id); up.notEquals(nonExistingProp, "none"); NodeDocument result = super.ds.findAndUpdate(Collection.NODES, up); assertNotNull(result); up = new UpdateOp(id, false); - up.set("_id", id); up.equals(nonExistingProp, null); result = super.ds.findAndUpdate(Collection.NODES, up); assertNotNull(result); up = new UpdateOp(id, false); - up.set("_id", id); up.notEquals(nonExistingRevisionProp, r, "none"); result = super.ds.findAndUpdate(Collection.NODES, up); assertNotNull(result); up = new UpdateOp(id, false); - up.set("_id", id); up.equals(nonExistingRevisionProp, r, null); result = super.ds.findAndUpdate(Collection.NODES, up); assertNotNull(result); up = new UpdateOp(id, false); - up.set("_id", id); up.equals(existingProp, "none"); result = super.ds.findAndUpdate(Collection.NODES, up); assertNull(result); up = new UpdateOp(id, false); - up.set("_id", id); up.equals(existingProp, null); result = super.ds.findAndUpdate(Collection.NODES, up); assertNull(result); up = new UpdateOp(id, false); - up.set("_id", id); up.equals(existingRevisionProp, r, "none"); result = super.ds.findAndUpdate(Collection.NODES, up); assertNull(result); up = new UpdateOp(id, false); - up.set("_id", id); up.equals(existingRevisionProp, r, null); result = super.ds.findAndUpdate(Collection.NODES, up); assertNull(result); up = new UpdateOp(id, false); - up.set("_id", id); up.notEquals(existingProp, "lock"); result = super.ds.findAndUpdate(Collection.NODES, up); assertNull(result); up = new UpdateOp(id, false); - up.set("_id", id); up.equals(existingProp, null); result = super.ds.findAndUpdate(Collection.NODES, up); assertNull(result); up = new UpdateOp(id, false); - up.set("_id", id); up.notEquals(existingRevisionProp, r, "lock"); result = super.ds.findAndUpdate(Collection.NODES, up); assertNull(result); up = new UpdateOp(id, false); - up.set("_id", id); up.equals(existingRevisionProp, r, null); result = super.ds.findAndUpdate(Collection.NODES, up); assertNull(result); up = new UpdateOp(id, false); - up.set("_id", id); up.equals(existingProp, "lock"); up.set(existingProp, "none"); result = super.ds.findAndUpdate(Collection.NODES, up); @@ -265,7 +245,6 @@ assertNotNull(result); up = new UpdateOp(id, false); - up.set("_id", id); up.equals(existingRevisionProp, r, "lock"); up.setMapEntry(existingRevisionProp, r, "none"); result = super.ds.findAndUpdate(Collection.NODES, up); @@ -286,7 +265,6 @@ try { UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.equals("foo", "bar"); super.ds.create(Collection.NODES, Collections.singletonList(up)); fail("conditional create should fail"); @@ -296,13 +274,11 @@ } UpdateOp cup = new UpdateOp(id, true); - cup.set("_id", id); assertTrue(super.ds.create(Collection.NODES, Collections.singletonList(cup))); removeMe.add(id); try { UpdateOp up = new UpdateOp(id, false); - up.set("_id", id); up.equals("foo", "bar"); super.ds.createOrUpdate(Collection.NODES, up); fail("conditional createOrUpdate should fail"); @@ -313,7 +289,6 @@ try { UpdateOp up = new UpdateOp(id, false); - up.set("_id", id); up.equals("foo", "bar"); super.ds.createOrUpdate(Collection.NODES, Collections.singletonList(up)); fail("conditional createOrUpdate should fail"); @@ -324,7 +299,6 @@ try { UpdateOp up = new UpdateOp(id, false); - up.set("_id", id); up.equals("foo", "bar"); super.ds.update(Collection.NODES, Collections.singletonList(id), up); fail("conditional update should fail"); @@ -352,7 +326,6 @@ if (! super.dsname.contains("Memory")) { UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); assertFalse("create() with ultra-long id needs to fail", super.ds.create(Collection.NODES, Collections.singletonList(up))); } } @@ -372,7 +345,6 @@ } catch (DocumentStoreException ignored) { } UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); if (success) { // check that we really can read it @@ -407,7 +379,6 @@ String id = this.getClass().getName() + ".testMaxProperty-" + test; String pval = generateString(test, true); UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("foo", pval); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); if (success) { @@ -434,7 +405,6 @@ String id = this.getClass().getName() + ".testInterestingPropLengths-" + test; String pval = generateString(test, true); UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("foo", pval); super.ds.remove(Collection.NODES, id); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); @@ -446,7 +416,6 @@ String id = this.getClass().getName() + ".testInterestingPropLengths-" + test; String pval = generateString(test, false); UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("foo", pval); super.ds.remove(Collection.NODES, id); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); @@ -480,17 +449,14 @@ } UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); assertTrue(super.ds.create(Collection.NODES, Collections.singletonList(up))); removeMe.add(id); up = new UpdateOp(id, false); - up.set("_id", id); up.set("f0", generateConstantString(3000)); super.ds.update(Collection.NODES, Collections.singletonList(id), up); up = new UpdateOp(id, false); - up.set("_id", id); up.set("f1", generateConstantString(967)); super.ds.update(Collection.NODES, Collections.singletonList(id), up); @@ -503,7 +469,6 @@ String id = this.getClass().getName() + ".testModifiedMaxUpdate"; // create a test node UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("_modified", 1000L); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); assertTrue(success); @@ -511,7 +476,6 @@ // update with smaller _modified UpdateOp up2 = new UpdateOp(id, true); - up2.set("_id", id); up2.max("_modified", 100L); super.ds.findAndUpdate(Collection.NODES, up2); @@ -530,7 +494,6 @@ String id = this.getClass().getName() + ".testModifiedMaxUpdate2"; // create a test node UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("_modified", 1000L); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); assertTrue(success); @@ -539,7 +502,6 @@ for (int i = 0; i < 25; i++) { // update with smaller _modified UpdateOp up2 = new UpdateOp(id, true); - up2.set("_id", id); up2.max("_modified", 100L); super.ds.findAndUpdate(Collection.NODES, up2); super.ds.invalidateCache(); @@ -554,7 +516,6 @@ String id = this.getClass().getName() + ".testModifyModified"; // create a test node UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("_modified", 1000L); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); assertTrue(success); @@ -562,7 +523,6 @@ // update with "max" operation up = new UpdateOp(id, false); - up.set("_id", id); up.max("_modified", 2000L); super.ds.update(Collection.NODES, Collections.singletonList(id), up); NodeDocument nd = super.ds.find(Collection.NODES, id, 0); @@ -570,7 +530,6 @@ // update with "set" operation up = new UpdateOp(id, false); - up.set("_id", id); up.set("_modified", 1500L); super.ds.update(Collection.NODES, Collections.singletonList(id), up); nd = super.ds.find(Collection.NODES, id, 0); @@ -583,7 +542,6 @@ String id = this.getClass().getName() + ".testModifyDeletedOnce"; // create a test node UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set(NodeDocument.DELETED_ONCE, Boolean.FALSE); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); assertTrue(success); @@ -598,7 +556,6 @@ // update up = new UpdateOp(id, false); - up.set("_id", id); up.set(NodeDocument.DELETED_ONCE, Boolean.TRUE); super.ds.update(Collection.NODES, Collections.singletonList(id), up); nd = super.ds.find(Collection.NODES, id, 0); @@ -623,7 +580,6 @@ String id = this.getClass().getName() + ".testInterestingStrings-" + testname; super.ds.remove(Collection.NODES, id); UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("foo", test); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); assertTrue("failed to insert a document with property value of " + test + " (" + testname + ") in " + super.dsname, success); @@ -650,7 +606,6 @@ // create one of the test nodes int pre = cnt / 2; UpdateOp up = new UpdateOp(bid + pre, true); - up.set("_id", bid + pre); up.set("foo", "bar"); assertTrue(super.ds.create(Collection.NODES, Collections.singletonList(up))); @@ -660,7 +615,6 @@ List ups = new ArrayList(); for (int i = 0; i < cnt; i++) { UpdateOp op = new UpdateOp(bid + i, true); - op.set("_id", bid + i); op.set("foo", "qux"); ups.add(op); if (i != pre) { @@ -708,7 +662,6 @@ String id = this.getClass().getName() + ".testDeleteNonExistingMultiple-" + UUID.randomUUID(); // create a test node UpdateOp up = new UpdateOp(id + "-2", true); - up.set("_id", id + "-2"); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); assertTrue(success); List todelete = new ArrayList(); @@ -726,7 +679,6 @@ // create a test node super.ds.remove(Collection.NODES, id); UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); assertTrue(success); removeMe.add(id); @@ -754,7 +706,6 @@ // create a test node super.ds.remove(Collection.SETTINGS, id); UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); boolean success = super.ds.create(Collection.SETTINGS, Collections.singletonList(up)); assertTrue(success); removeMeSettings.add(id); @@ -764,7 +715,6 @@ assertNull("_modified should be null until set", m); up = new UpdateOp(id, true); - up.set("_id", id); up.set("_modified", 123L); super.ds.findAndUpdate(Collection.SETTINGS, up); @@ -774,7 +724,6 @@ assertEquals("123", m.toString()); up = new UpdateOp(id, true); - up.set("_id", id); up.max("_modified", 122L); super.ds.findAndUpdate(Collection.SETTINGS, up); @@ -784,7 +733,6 @@ assertEquals("123", m.toString()); up = new UpdateOp(id, true); - up.set("_id", id); up.max("_modified", 124L); super.ds.findAndUpdate(Collection.SETTINGS, up); @@ -802,7 +750,6 @@ for (int i = 0; i < 10; i++) { String id = base + i; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); assertTrue("document with " + id + " not created", success); removeMe.add(id); @@ -826,7 +773,6 @@ for (int i = 0; i < 10; i++) { String id = base + i; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set(NodeDocument.HAS_BINARY_FLAG, i % 2L); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); assertTrue("document with " + id + " not created", success); @@ -847,7 +793,6 @@ for (int i = 0; i < 10; i++) { String id = base + i; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set(NodeDocument.DELETED_ONCE, Boolean.valueOf(i % 2 == 0)); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); assertTrue("document with " + id + " not created", success); @@ -872,12 +817,10 @@ for (char c : "!\"#$%&'()*+,-./0123456789:;<=>?@AZ[\\]^_`az{|}~".toCharArray()) { String id = base + c; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); creates.add(up); removeMe.add(id); id = base + "/" + c; up = new UpdateOp(id, true); - up.set("_id", id); creates.add(up); expected.add(id); removeMe.add(id); @@ -938,7 +881,6 @@ // add Revision revision = Revision.fromString("r0-0-1"); UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.setMapEntry("_collisions", revision, "foo"); assertTrue(super.ds.create(Collection.NODES, Collections.singletonList(up))); removeMe.add(id); @@ -954,7 +896,6 @@ // update Revision revision2 = Revision.fromString("r0-0-2"); UpdateOp up2 = new UpdateOp(id, false); - up2.set("_id", id); up2.setMapEntry("_collisions", revision2, "foobar"); NodeDocument old = super.ds.findAndUpdate(Collection.NODES, up2); assertNotNull(old); @@ -967,7 +908,6 @@ // update UpdateOp up3 = new UpdateOp(id, false); - up3.set("_id", id); up3.set("foo", "bar"); old = super.ds.findAndUpdate(Collection.NODES, up3); assertNotNull(old); @@ -989,7 +929,6 @@ @Test public void testServerTimeDiff() throws Exception { UpdateOp up = new UpdateOp("0:/", true); - up.set("_id", "0:/"); super.ds.create(Collection.NODES, Collections.singletonList(up)); removeMe.add("0:/"); long td = super.ds.determineServerTimeDifferenceMillis(); @@ -1057,7 +996,6 @@ String id = Utils.getIdFromPath(path); UpdateOp op = new UpdateOp(id, true); op.set(NodeDocument.MODIFIED_IN_SECS, modified); - op.set(Document.ID, id); return op; } Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BulkCreateOrUpdateClusterTest.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BulkCreateOrUpdateClusterTest.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BulkCreateOrUpdateClusterTest.java (working copy) @@ -53,7 +53,6 @@ for (int i = 0; i < amount; i += 2) { String id = this.getClass().getName() + ".testConcurrentNoConflict" + i; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("prop", 100); updates.add(up); } @@ -68,7 +67,6 @@ for (int j = 0; j < amountPerThread; j++) { String id = this.getClass().getName() + ".testConcurrentNoConflict" + (j + i * amountPerThread); UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("prop", 200 + i + j); threadUpdates.add(up); removeMe.add(id); @@ -138,7 +136,6 @@ for (int i = 0; i < amount; i += 2) { String id = this.getClass().getName() + ".testConcurrentNoConflict" + i; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("prop", 100); updates.add(up); removeMe.add(id); @@ -153,7 +150,6 @@ for (int j = 0; j < amount; j++) { String id = this.getClass().getName() + ".testConcurrentWithConflict" + j; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("prop", 200 + i * amount + j); threadUpdates.add(up); removeMe.add(id); Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BulkCreateOrUpdateTest.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BulkCreateOrUpdateTest.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BulkCreateOrUpdateTest.java (working copy) @@ -75,7 +75,6 @@ for (int i = 0; i < amount; i++) { String id = this.getClass().getName() + ".testCreateMultiple" + i; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); updates.add(up); removeMe.add(id); } @@ -100,7 +99,6 @@ for (int i = 0; i < amount; i++) { String id = this.getClass().getName() + ".testUpdateMultiple" + i; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("prop", 100); updates.add(up); removeMe.add(id); @@ -141,7 +139,6 @@ for (int i = 0; i < amount; i += 2) { String id = this.getClass().getName() + ".testCreateOrUpdateMultiple" + i; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("prop", 100); updates.add(up); removeMe.add(id); @@ -153,7 +150,6 @@ for (int i = 0; i < amount; i++) { String id = this.getClass().getName() + ".testCreateOrUpdateMultiple" + i; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("prop", 200); updates.add(up); removeMe.add(id); @@ -191,7 +187,6 @@ for (int i = 0; i < amount; i += 2) { String id = this.getClass().getName() + ".testConcurrentNoConflict" + i; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("prop", 100); updates.add(up); } @@ -204,7 +199,6 @@ for (int j = 0; j < amountPerThread; j++) { String id = this.getClass().getName() + ".testConcurrentNoConflict" + (j + i * amountPerThread); UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("prop", 200 + i + j); threadUpdates.add(up); removeMe.add(id); @@ -262,7 +256,6 @@ for (int i = 0; i < amount; i += 2) { String id = this.getClass().getName() + ".testConcurrentNoConflict" + i; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("prop", 100); updates.add(up); removeMe.add(id); @@ -276,7 +269,6 @@ for (int j = 0; j < amount; j++) { String id = this.getClass().getName() + ".testConcurrentWithConflict" + j; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("prop", 200 + i * amount + j); threadUpdates.add(up); removeMe.add(id); @@ -330,7 +322,6 @@ for (int i = 0; i < amount; i++) { UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("update_id", i); up.set("prop_" + i, 100); updates.add(up); Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/CacheConsistencyTestBase.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/CacheConsistencyTestBase.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/CacheConsistencyTestBase.java (working copy) @@ -61,15 +61,12 @@ public void testExceptionInvalidatesCache() { String id1 = this.getClass().getName() + ".testExceptionInvalidatesCache1"; UpdateOp up1 = new UpdateOp(id1, true); - up1.set("_id", id1); up1.set("_test", "oldvalue"); String id2 = this.getClass().getName() + ".testExceptionInvalidatesCache2"; UpdateOp up2 = new UpdateOp(id2, true); - up2.set("_id", id2); up2.set("_test", "oldvalue"); String id3 = this.getClass().getName() + ".testExceptionInvalidatesCache3"; UpdateOp up3 = new UpdateOp(id3, true); - up3.set("_id", id3); up3.set("_test", "oldvalue"); ds.create(Collection.NODES, Lists.newArrayList(up1, up2, up3)); removeMe.add(id1); @@ -92,7 +89,6 @@ setTemporaryUpdateException(random); try { up1 = new UpdateOp(id1, false); - up1.set("_id", id1); up1.set("_test", random); ds.findAndUpdate(Collection.NODES, up1); fail("should have failed with DocumentStoreException"); @@ -116,7 +112,6 @@ setTemporaryUpdateException(random); try { up1 = new UpdateOp(id1, false); - up1.set("_id", id1); up1.set("_test", random); ds.update(Collection.NODES, Collections.singletonList(id1), up1); fail("should have failed with DocumentStoreException"); @@ -140,7 +135,6 @@ setTemporaryUpdateException(random); try { up1 = new UpdateOp(id1, false); - up1.set("_id", id1); up1.set("_test", random); ds.createOrUpdate(Collection.NODES, up1); fail("should have failed with DocumentStoreException"); @@ -169,13 +163,10 @@ setTemporaryUpdateException(random); try { up1 = new UpdateOp(id1, false); - up1.set("_id", id1); up1.set("_test", random); up2 = new UpdateOp(id2, false); - up2.set("_id", id2); up2.set("_test", random); up3 = new UpdateOp(id3, false); - up3.set("_id", id3); up3.set("_test", random); ds.createOrUpdate(Collection.NODES, Lists.newArrayList(up1, up2, up3)); Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ClusterInfoTest.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ClusterInfoTest.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ClusterInfoTest.java (working copy) @@ -168,7 +168,6 @@ long waitFor = 2000; // modify record to indicate "active" with a lease end in the future UpdateOp up = new UpdateOp("" + cid, false); - up.set(Document.ID, "" + cid); up.set(ClusterNodeInfo.STATE, ClusterNodeState.ACTIVE.toString()); long now = clock.getTime(); up.set(ClusterNodeInfo.LEASE_END_KEY, now + waitFor); Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentDocumentStoreTest.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentDocumentStoreTest.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentDocumentStoreTest.java (working copy) @@ -42,7 +42,6 @@ // RDBDocumentStore String id = this.getClass().getName() + ".testConcurrentUpdate"; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("thread", Thread.currentThread().getName()); up.set("counter", 0L); ds.create(Collection.NODES, Collections.singletonList(up)); @@ -108,7 +107,6 @@ public void run() { try { UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("thread", Thread.currentThread().getName()); up.increment("counter", 1L); if (create) { Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentQueryAndInvalidateIT.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentQueryAndInvalidateIT.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentQueryAndInvalidateIT.java (working copy) @@ -80,7 +80,6 @@ String id = Utils.getIdFromPath("/node-" + i); ids.add(id); UpdateOp op = new UpdateOp(id, true); - op.set(Document.ID, id); NodeDocument.setLastRev(op, r); ops.add(op); removeMe.add(id); Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentQueryAndUpdateIT.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentQueryAndUpdateIT.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentQueryAndUpdateIT.java (working copy) @@ -49,7 +49,6 @@ String id = Utils.getIdFromPath("/node-" + i); ids.add(id); UpdateOp op = new UpdateOp(id, true); - op.set(Document.ID, id); NodeDocument.setLastRev(op, r); ops.add(op); removeMe.add(id); Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentStorePerformanceTest.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentStorePerformanceTest.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentStorePerformanceTest.java (working copy) @@ -84,7 +84,6 @@ for (int i = 0; i < amount; i++) { String id = this.getClass().getName() + ".testCreatePerf-" + size + "-" + cnt + "-" + i; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("foo", pval); ups.add(up); ids.add(id); @@ -120,7 +119,6 @@ List ups = new ArrayList(); UpdateOp container = new UpdateOp(cid, true); - container.set("_id", cid); ups.add(container); removeMe.add(cid); for (int i = 0; i < nodecount; i++) { @@ -127,7 +125,6 @@ String id = String.format("%s/%08d", cid, i); removeMe.add(id); UpdateOp u = new UpdateOp(id, true); - u.set("_id", id); ups.add(u); } @@ -189,7 +186,6 @@ super.ds.remove(Collection.NODES, id); removeMe.add(id); UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("testprop", generateString(100 * i, true)); up.setMapEntry("_lastRev", cr, "setup"); up.set("_modified", NodeDocument.getModifiedInSecs(System.currentTimeMillis())); @@ -237,7 +233,6 @@ super.ds.remove(Collection.NODES, Collections.singletonList(id)); UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); for (int i = 0; i < 100; i++) { up.set("foo" + i, generateString(1024, true)); } @@ -285,7 +280,6 @@ while (System.currentTimeMillis() < end) { UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); if (growing) { Revision r = new Revision(System.currentTimeMillis(), (int) cnt, 1); up.setMapEntry("foo", r, pval); @@ -333,7 +327,6 @@ ds1.remove(Collection.NODES, id); UpdateOp up = new UpdateOp(id, true); - up.set(Document.ID, id); up.set(Document.MOD_COUNT, 1L); up.set("c", 0L); up.set("u", 0L); @@ -380,7 +373,6 @@ int failures = 0; // operation that does not require fetching the previous state UpdateOp up = new UpdateOp(id, false); - up.set(Document.ID, id); up.increment("u", 1); while (!threadOneIsDone.get()) { try { Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentStoreStatsIT.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentStoreStatsIT.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentStoreStatsIT.java (working copy) @@ -62,7 +62,6 @@ String id = testName.getMethodName(); UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); ds.create(Collection.NODES, singletonList(up)); removeMe.add(id); @@ -74,7 +73,6 @@ String id = testName.getMethodName(); UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); ds.create(Collection.NODES, singletonList(up)); removeMe.add(id); @@ -93,7 +91,6 @@ for (int i = 0; i < 10; i++) { String id = base + i; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); assertTrue("document with " + id + " not created", success); removeMe.add(id); @@ -113,7 +110,6 @@ String id = testName.getMethodName(); UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); ds.create(Collection.NODES, singletonList(up)); removeMe.add(id); @@ -133,7 +129,6 @@ String id = testName.getMethodName(); UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); ds.create(Collection.NODES, singletonList(up)); removeMe.add(id); @@ -142,7 +137,6 @@ up = new UpdateOp(id, true); - up.set("_id", id); up.max("_modified", 122L); ds.findAndUpdate(Collection.NODES, up); Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/LastRevRecoveryTest.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/LastRevRecoveryTest.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/LastRevRecoveryTest.java (working copy) @@ -299,6 +299,9 @@ private static UpdateOp updateOpFromDocument(Document doc) { UpdateOp op = new UpdateOp(doc.getId(), true); for (String key : doc.keySet()) { + if (key.equals(Document.ID)) { + continue; + } Object obj = doc.get(key); if (obj instanceof Map) { @SuppressWarnings("unchecked") Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/MongoDocumentStoreIT.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/MongoDocumentStoreIT.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/MongoDocumentStoreIT.java (working copy) @@ -169,7 +169,6 @@ DocumentStore store = mk.getDocumentStore(); String id = Utils.getIdFromPath("/test"); UpdateOp updateOp = new UpdateOp(id, true); - updateOp.set(Document.ID, id); Revision r1 = Revision.newRevision(1); updateOp.setMapEntry("p", r1, "a"); Revision r2 = Revision.newRevision(1); @@ -191,7 +190,6 @@ DocumentStore store = mk.getDocumentStore(); String id = Utils.getIdFromPath("/test"); UpdateOp updateOp = new UpdateOp(id, true); - updateOp.set(Document.ID, id); Revision r1 = Revision.newRevision(1); updateOp.setMapEntry("p", r1, "a"); Revision r2 = Revision.newRevision(1); Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/MongoDocumentStoreTest.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/MongoDocumentStoreTest.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/MongoDocumentStoreTest.java (working copy) @@ -118,7 +118,6 @@ for (int i = 0; i < nUpdates; i++) { String path = "/node" + i; UpdateOp updateOp = new UpdateOp(path, true); - updateOp.set(Document.ID, "/node" + i); updateOp.setMapEntry("property1", r1, "value1"); updateOp.increment("property2", 1); updateOp.set("property3", "value3"); @@ -146,7 +145,6 @@ for (int i = 0; i < nUpdates; i++) { String path = "/node" + i; UpdateOp updateOp = new UpdateOp(path, true); - updateOp.set(Document.ID, "/node" + i); updateOp.setMapEntry("property1", r1, "value1"); updateOp.increment("property2", 1); updateOp.set("property3", "value3"); Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/MultiDocumentStoreTest.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/MultiDocumentStoreTest.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/MultiDocumentStoreTest.java (working copy) @@ -58,7 +58,6 @@ } UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("_foo", 0); assertTrue(super.ds1.create(Collection.NODES, Collections.singletonList(up))); removeMe.add(id); @@ -67,7 +66,6 @@ for (int i = 0; i < increments; i++) { up = new UpdateOp(id, true); - up.set("_id", id); up.increment("_foo", 1); if (i % 2 == 0) { super.ds1.update(Collection.NODES, Collections.singletonList(id), up); @@ -95,7 +93,6 @@ } UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("_foo", "bar"); assertTrue(super.ds1.create(Collection.NODES, Collections.singletonList(up))); removeMe.add(id); @@ -112,7 +109,6 @@ // update through ds1 UpdateOp upds1 = new UpdateOp(id, true); - upds1.set("_id", id); upds1.set("foo", "qux"); super.ds1.update(Collection.NODES, Collections.singletonList(id), upds1); nd1 = super.ds1.find(Collection.NODES, id); @@ -132,7 +128,6 @@ // update through ds2 UpdateOp upds2 = new UpdateOp(id, true); - upds2.set("_id", id); upds2.set("foo", "blub"); super.ds2.update(Collection.NODES, Collections.singletonList(id), upds1); nd2 = super.ds2.find(Collection.NODES, id); @@ -172,7 +167,6 @@ for (int i = 0; i < halfAmount; i++) { String id = baseId + "-" + i; UpdateOp up = new UpdateOp(id, true); - up.set(Document.ID, id); up.set("_createdby", "ds1"); ops.add(up); } @@ -189,7 +183,6 @@ for (int i = 0; i < amount; i++) { String id = baseId + "-" + i; UpdateOp up = new UpdateOp(id, true); - up.set(Document.ID, id); up.set("_createdby", "ds2"); ops.add(up); } @@ -234,7 +227,6 @@ List ops = Lists.newArrayList(); for (String id : ids) { UpdateOp op = new UpdateOp(id, true); - op.set(Document.ID, id); op.set("_t1", "value"); ops.add(op); } @@ -259,7 +251,6 @@ List ops = Lists.newArrayList(); for (String id : ids) { UpdateOp op = new UpdateOp(id, true); - op.set(Document.ID, id); op.set("_t2", "value"); ops.add(op); } @@ -304,7 +295,6 @@ removeMe.add(id); UpdateOp op = new UpdateOp(id, true); - op.set(Document.ID, id); op.set("_ds1", 1); assertNull(ds1.createOrUpdate(Collection.NODES, op)); @@ -326,7 +316,6 @@ // update call is triggered String docId = Utils.getIdFromPath("/node-" + i); UpdateOp update = new UpdateOp(docId, true); - update.set(Document.ID, docId); update.set("_ds2", 1); removeMe.add(docId); ops.add(update); @@ -349,7 +338,6 @@ super.ds1.remove(Collection.NODES, id); UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("_foo", 0); up.set("_bar", 0); assertTrue(super.ds1.create(Collection.NODES, Collections.singletonList(up))); @@ -361,7 +349,6 @@ long origMc = orig.getModCount(); UpdateOp up2 = new UpdateOp(id, false); - up2.set("_id", id); up2.increment("_foo", 1L); super.ds2.update(Collection.NODES, Collections.singletonList(id), up2); NodeDocument ds2doc = super.ds2.find(Collection.NODES, id); @@ -369,7 +356,6 @@ assertTrue("_modCount needs to be > " + origMc + " but was " + ds2Mc, ds2Mc > origMc); UpdateOp up1 = new UpdateOp(id, false); - up1.set("_id", id); up1.increment("_bar", 1L); super.ds1.update(Collection.NODES, Collections.singletonList(id), up1); @@ -386,7 +372,6 @@ ds2.invalidateCache(); removeMe.add(id); UpdateOp op = new UpdateOp(id, true); - op.set(Document.ID, id); ds1.create(Collection.NODES, Collections.singletonList(op)); List exceptions = Collections.synchronizedList(new ArrayList()); Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ResurrectNodeAfterRevisionGCTest.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ResurrectNodeAfterRevisionGCTest.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ResurrectNodeAfterRevisionGCTest.java (working copy) @@ -199,7 +199,6 @@ private void resurrectInvalidateWithModified(Invalidate inv) throws Exception { UpdateOp op = new UpdateOp(getIdFromPath("/foo"), true); - op.set(Document.ID, op.getId()); op.set("p", 0); op.set(NodeDocument.MODIFIED_IN_SECS, 50); assertTrue(ds1.create(Collection.NODES, Lists.newArrayList(op))); @@ -223,7 +222,6 @@ private void resurrectInvalidate(Invalidate inv) throws Exception { UpdateOp op = new UpdateOp(getIdFromPath("/foo"), true); - op.set(Document.ID, op.getId()); op.set("p", 0); assertTrue(ds1.create(Collection.NODES, Lists.newArrayList(op))); NodeDocument doc = ds2.find(Collection.NODES, op.getId()); Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ValueMapTest.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ValueMapTest.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ValueMapTest.java (working copy) @@ -51,7 +51,6 @@ MemoryDocumentStore store = new MemoryDocumentStore(); // create previous docs UpdateOp op = new UpdateOp(Utils.getPreviousIdFor(rootPath, r0, 0), true); - op.set(ID, op.getId()); op.setMapEntry("prop", r0, "0"); NodeDocument.setRevision(op, r0, "c"); store.createOrUpdate(NODES, op); @@ -58,7 +57,6 @@ Revision r1low = new Revision(1, 0, 1); Revision r1high = new Revision(1, 10, 1); op = new UpdateOp(Utils.getPreviousIdFor(rootPath, r1high, 0), true); - op.set(ID, op.getId()); for (int i = r1low.getCounter(); i <= r1high.getCounter(); i++) { Revision r = new Revision(1, i, 1); op.setMapEntry("foo", r, String.valueOf(i)); @@ -67,7 +65,6 @@ store.createOrUpdate(NODES, op); // create root doc op = new UpdateOp(rootId, true); - op.set(ID, op.getId()); Revision r2 = new Revision(2, 0, 1); op.setMapEntry("prop", r2, "1"); NodeDocument.setRevision(op, r2, "c"); @@ -101,7 +98,6 @@ Revision r51 = new Revision(5, 0, 1); // create previous docs UpdateOp op = new UpdateOp(Utils.getPreviousIdFor(rootPath, r31, 0), true); - op.set(ID, op.getId()); op.setMapEntry("p0", r01, "0"); NodeDocument.setRevision(op, r01, "c"); op.setMapEntry("p1", r31, "1"); @@ -109,7 +105,6 @@ store.createOrUpdate(NODES, op); op = new UpdateOp(Utils.getPreviousIdFor(rootPath, r42, 0), true); - op.set(ID, op.getId()); op.setMapEntry("p1", r12, "0"); NodeDocument.setRevision(op, r12, "c"); op.setMapEntry("p1", r22, "1"); @@ -120,7 +115,6 @@ // create root doc op = new UpdateOp(rootId, true); - op.set(ID, op.getId()); op.setMapEntry("p0", r51, "2"); op.setMapEntry("p1", r51, "2"); NodeDocument.setRevision(op, r51, "c"); @@ -196,13 +190,11 @@ String prevId1 = Utils.getPreviousIdFor("/", range1.high, 0); UpdateOp prevOp1 = new UpdateOp(prevId1, true); - prevOp1.set(Document.ID, prevId1); NodeDocument.setRevision(prevOp1, r5, "c"); NodeDocument.setRevision(prevOp1, r7, "c"); String prevId2 = Utils.getPreviousIdFor("/", range2.high, 0); UpdateOp prevOp2 = new UpdateOp(prevId2, true); - prevOp2.set(Document.ID, prevId2); NodeDocument.setRevision(prevOp2, r1, "c"); NodeDocument.setRevision(prevOp2, r2, "c"); NodeDocument.setRevision(prevOp2, r4, "c"); @@ -209,7 +201,6 @@ String rootId = Utils.getIdFromPath("/"); UpdateOp op = new UpdateOp(rootId, true); - op.set(Document.ID, rootId); NodeDocument.setRevision(op, r3, "c"); NodeDocument.setRevision(op, r6, "c"); NodeDocument.setPrevious(op, range1); Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollectorIT.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollectorIT.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollectorIT.java (working copy) @@ -522,7 +522,6 @@ // add a document with a malformed id String id = "42"; UpdateOp op = new UpdateOp(id, true); - op.set(ID, id); NodeDocument.setDeletedOnce(op); NodeDocument.setModified(op, store.newRevision()); store.getDocumentStore().create(NODES, Lists.newArrayList(op)); Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreJDBCTest.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreJDBCTest.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreJDBCTest.java (working copy) @@ -74,7 +74,6 @@ String id = this.getClass().getName() + ".conditionalRead"; super.ds.remove(Collection.NODES, id); UpdateOp op = new UpdateOp(id, true); - op.set("_id", id); op.set("_modified", 1L); removeMe.add(id); assertTrue(super.ds.create(Collection.NODES, Collections.singletonList(op))); Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreTest.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreTest.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreTest.java (working copy) @@ -48,7 +48,6 @@ for (int i = 0; i < 10; i++) { String id = base + i; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set(NodeDocument.DELETED_ONCE, i % 2 == 1); up.set(NodeDocument.MODIFIED_IN_SECS, now++); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); @@ -77,7 +76,6 @@ // every second is a "regular" path String id = "1:" + (i % 2 == 1 ? "p" : "") + "/" + base + i; UpdateOp up = new UpdateOp(id, true); - up.set("_id", id); up.set("_test", base); boolean success = super.ds.create(Collection.NODES, Collections.singletonList(up)); assertTrue("document with " + id + " not created", success); Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/TimingDocumentStoreWrapperTest.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/TimingDocumentStoreWrapperTest.java (revision 1767703) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/TimingDocumentStoreWrapperTest.java (working copy) @@ -31,7 +31,6 @@ public void createOrUpdate() { DocumentStore store = new TimingDocumentStoreWrapper(new MemoryDocumentStore()); UpdateOp op = new UpdateOp("foo", true); - op.set(Document.ID, "foo"); store.createOrUpdate(Collection.NODES, Collections.singletonList(op)); } }