# HG changeset patch # User dirk # Date 1316331460 -7200 # Node ID 8d5f791f18118e8e95e25cefd348f769f6cf01e5 # Parent eea7df5137ac921b2a13e53f1584ea1bbd408b43 do not use findValue as it searches recursively. This is not what we want in all the cases findValue was used before. diff -r eea7df5137ac -r 8d5f791f1811 conflict-editor/src/main/java/de/codedo/conflicteditor/Conflict.java --- a/conflict-editor/src/main/java/de/codedo/conflicteditor/Conflict.java Sun Sep 18 09:35:43 2011 +0200 +++ b/conflict-editor/src/main/java/de/codedo/conflicteditor/Conflict.java Sun Sep 18 09:37:40 2011 +0200 @@ -10,7 +10,7 @@ public Conflict(JsonNode node) { super(); - _currentVersionNode = node.findValue("key"); + _currentVersionNode = node.get("key"); } public JsonNode getCurrentDocument() @@ -20,7 +20,7 @@ public String getId() { - return _currentVersionNode.findValue("_id").getTextValue(); + return _currentVersionNode.get("_id").getTextValue(); } /** @@ -28,7 +28,7 @@ */ public String getRevision() { - return _currentVersionNode.findValue("_rev").getTextValue(); + return _currentVersionNode.get("_rev").getTextValue(); } /** @@ -36,7 +36,7 @@ */ public String getConflictRevision() { - JsonNode conflictsNode = _currentVersionNode.findValue("_conflicts"); + JsonNode conflictsNode = _currentVersionNode.get("_conflicts"); if (conflictsNode.isArray()) { return conflictsNode.get(0).getTextValue(); diff -r eea7df5137ac -r 8d5f791f1811 conflict-editor/src/main/java/de/codedo/conflicteditor/ConflictsView.java --- a/conflict-editor/src/main/java/de/codedo/conflicteditor/ConflictsView.java Sun Sep 18 09:35:43 2011 +0200 +++ b/conflict-editor/src/main/java/de/codedo/conflicteditor/ConflictsView.java Sun Sep 18 09:37:40 2011 +0200 @@ -73,6 +73,6 @@ { ObjectMapper mapper = new ObjectMapper(); JsonNode rootNode = mapper.readTree(reader); - return rootNode.findValue("rows"); + return rootNode.get("rows"); } } diff -r eea7df5137ac -r 8d5f791f1811 conflict-editor/src/main/java/de/codedo/conflicteditor/DocumentMatcher.java --- a/conflict-editor/src/main/java/de/codedo/conflicteditor/DocumentMatcher.java Sun Sep 18 09:35:43 2011 +0200 +++ b/conflict-editor/src/main/java/de/codedo/conflicteditor/DocumentMatcher.java Sun Sep 18 09:37:40 2011 +0200 @@ -47,7 +47,7 @@ for (String name : calculateFieldNamesInOriginalOnly()) { // TODO value may not be text - String value = _original.findValue(name).getTextValue(); + String value = _original.get(name).getTextValue(); Difference diff = new Difference(name, value, null); _differences.add(diff); } @@ -66,7 +66,7 @@ for (String name : calculateFieldNamesInOtherOnly()) { // TODO value may not be text - String value = _other.findValue(name).getTextValue(); + String value = _other.get(name).getTextValue(); Difference diff = new Difference(name, null, value); _differences.add(diff); } @@ -102,8 +102,8 @@ private Difference compareValuesForKey(String key) { - JsonNode original = _original.findValue(key); - JsonNode other = _other.findValue(key); + JsonNode original = _original.get(key); + JsonNode other = _other.get(key); if ((original != null) && (other == null)) { diff -r eea7df5137ac -r 8d5f791f1811 conflict-editor/src/test/java/de/codedo/conflicteditor/ConflictTestCase.java --- a/conflict-editor/src/test/java/de/codedo/conflicteditor/ConflictTestCase.java Sun Sep 18 09:35:43 2011 +0200 +++ b/conflict-editor/src/test/java/de/codedo/conflicteditor/ConflictTestCase.java Sun Sep 18 09:37:40 2011 +0200 @@ -43,7 +43,7 @@ private ObjectNode createNodeWithConflictRevisions(String... revisions) { ObjectNode node = createBaseNode(); - ObjectNode keyNode = (ObjectNode)node.findValue("key"); + ObjectNode keyNode = (ObjectNode)node.get("key"); ArrayNode conflicts = node.arrayNode(); for (String revision : revisions) diff -r eea7df5137ac -r 8d5f791f1811 conflict-editor/src/test/java/de/codedo/conflicteditor/Playground.java --- a/conflict-editor/src/test/java/de/codedo/conflicteditor/Playground.java Sun Sep 18 09:35:43 2011 +0200 +++ b/conflict-editor/src/test/java/de/codedo/conflicteditor/Playground.java Sun Sep 18 09:37:40 2011 +0200 @@ -27,7 +27,7 @@ { Conflict conflict = new Conflict(conflicts.get(i)); JsonNode currentDocument = conflict.getCurrentDocument(); - System.out.println(currentDocument.findValue("rss_url").getTextValue()); + System.out.println(currentDocument.get("rss_url").getTextValue()); // System.out.println("current:"); // prettyPrint(currentDocument);