// slightly experimental - also uses allChanged() which might not be // so good with future logging svoid swapConceptIDs(Concept a, Concept b) { Concepts concepts = a._concepts; if (concepts != b._concepts) fail("Concepts belong to different set"); long id1 = a.id, id2 = b.id; if (concepts == null) { a.id = id2; b.id = id1; ret; } lock concepts.lock; a.id = id2; b.id = id1; concepts.concepts.put(id2, a); concepts.concepts.put(id1, b); a.change(); b.change(); }