Repository navigation
Conversation
Signed-off-by: Jaehong Park <105151063+PHJ2000@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A generated patch can silently move the wrong array element when move factorization postpones a removal past another removal. For example, diffing
{"a":[1,2],"b":[]}to{"a":[],"b":[1]}currently generatesremove /a/0followed bymove /a/0 -> /b/-, producing{"a":[],"b":[2]}.Only factor the immediately preceding removal into a move. Earlier removals keep their original position because intervening operations may depend on their effect on array indices. This trades some patch compactness for preserving the generated patch's meaning; adjacent removal/addition pairs still use move operations.
Fixes #155. The patch generated from the original A and B attachments now produces B correctly.
Validation:
JsonPatchTestSuite, pass on JDK 8 and JDK 11.repo.springsource.orgno longer resolves forpropdeps-plugin:0.0.7. The tests were run with a temporary Maven harness using the dependencies inproject.gradle, Java 7 source/target levels, and the repository's actual source/test/resource directories. The Gradle build and Error Prone checks remain unverified; no alternative build files are included in this PR.git diff --checkpasses.