Skip to content

Add factorizing support for converting duplicate add to copy operations #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2013
Merged

Conversation

rwatler
Copy link
Contributor

@rwatler rwatler commented Apr 12, 2013

Added simple logic to and convert subsequent duplicate value'd add operations to copy operations along with test cases. Only non-empty array and object add values are considered since using copy operations for single or simple values would not the reduce patch operation count and would obfuscate patches that otherwise might be trivial.

There is only one wrinkle with this implementation: adds that are appending values to the end of a list cannot be used for subsequent copies. This is because the value does not have a concrete path from which to copy, (the from path cannot be computed easily based on the diff data currently available). This case should be generally rare and probably is not worth writing special case code or abandoning the append path in general to make work. The new test cases include an example of this limitation.

fge added a commit that referenced this pull request Apr 12, 2013
Add factorizing support for converting duplicate add to copy operations
@fge fge merged commit f0febdc into java-json-tools:master Apr 12, 2013
fge added a commit that referenced this pull request Apr 12, 2013
* New diff implementation (courtesy of Randy Watler)
* Mark old diff implementation as deprecated

Francis Galiegue (26):
      Announce version 1.1
      Merge pull request #1 from rwatler/factorizing-diff
      Update copyrights
      Changes to pom.xml: add contributors
      JsonFactorizingDiff: modify a little
      JsonFactorizingDiff: modify more code
      JsonFactorizingDiff: more modifications
      JsonFactorizingDiff: replace Integer.MAX_VALUE with -1 for "not array index"
      JsonFactorizingDiff: more changes
      JsonFactorizingDiff: more changes
      JsonFactorizingDiff: refactor DiffOperation
      Add comments in DiffOperation
      JsonFactorizingDiff: implement .toString() on Diff{,Operation}
      JsonDiff: some code simplification
      JsonFactorizingDiff: take advantage of ArrayNode's properties
      JsonFactorizingDiff: refactor getLCSDiffs a little
      Update README
      Update README again
      Merge pull request #2 from rwatler/master
      Merge pull request #3 from rwatler/master
      JsonFactorizingDiff: add comments
      Move JsonFactorizingDiff into its own package
      Add javadoc to new JsonDiff implementation; obsolete old one.
      Schedule old JSON diff removal for 1.3, not 1.4
      pom.xml: remove unused javadoc link
      1.2

Randy Watler (3):
      Add proposed Factorizing JSON Diff implementation
      Revise factorizing implementation and test cases to cover multiple overlapping add/remove diff array index adjustments
      Add factorizing support for converting duplicate add to copy operations
hnguyen08 added a commit to hnguyen08/json-patch that referenced this pull request Sep 30, 2015
…ration

Add omit? operation and refactor packages
stephanedaviet pushed a commit to stephanedaviet/json-patch that referenced this pull request Apr 6, 2019
Hieu Nguyen (10):
    Missed an OPERATION_NAME replace in CopyOperation
    Add omit? operation and refactor packages
    Removing the JsonPatchOperationFactory and just using TypeInfo annotation mixins for jackson deserialization/serialization
    Remove annotations and instead introduce a ExtendedJsonPatch and ExtendedJsonPatchOperation
    Add factory methods for mappers that can deserialize standard and extended JSON patch operations
    Remove ExtendedJsonPatchOperation
    Remove JsonSubTypes annotations on JsonPatchOperation (because we are using registerSubtypes)
    Code review changes
    Creating a Standard and Extended JsonPatchFactory that houses the ObjectMapper
    Set version to 1.12

hnguyen08 (3):
    Merge pull request java-json-tools#2 from hnguyen08/omit_merged
    Merge pull request java-json-tools#3 from hnguyen08/omit_optional_operation
    Merge pull request java-json-tools#6 from hnguyen08/remove_factories_and_support_deserialization

Add missing notes for versions 1.10, 1.11, 1.12
BartekGravity referenced this pull request in gravity9-tech/json-patch-path Jun 20, 2023
BartekGravity referenced this pull request in gravity9-tech/json-patch-path Jun 20, 2023
[US642] Update project settings (#3)
BartekGravity referenced this pull request in gravity9-tech/json-patch-path Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants