Permalink
Browse files

Not move array boundaries when start is already on array start. Close #…

  • Loading branch information...
1 parent 3df3d17 commit 11e18d2951983bb463bc10ff721c1d4bc35703d0 @algesten committed Nov 18, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/main/java/foodev/jsondiff/JsonDiff.java
View
6 src/main/java/foodev/jsondiff/JsonDiff.java
@@ -553,6 +553,12 @@ private static int findArrayMutationAdjustment(ArrayList<Leaf> leaves, int start
return -1;
}
+ // no action if beginning is
+ // already positioned at array node (issue #13)
+ if (leaves.get(start).parent instanceof ArrNode) {
+ return -1;
+ }
+
int firstArrayElementAt = -1;
// search for first any array element in range

0 comments on commit 11e18d2

Please sign in to comment.