Skip to content

Provide a mechanism to create a new delta from an existing delta without caring about its type #75

@cowwoc

Description

@cowwoc

I am writing a method that needs to break a delta into pieces (e.g. two deltas that result in the same patch as the original delta). The current design is problematic because:

  1. I don't want my method to know/care what the delta type is.
  2. The AbstractDelta class is abstract, so I cannot simply invoke its constructor.
  3. The AbstractDelta subtypes do not provide with() methods.
  4. Some of your code (e.g. DiffRowGenerator) check the class type instance (e.g. if (delta instanceof InsertDelta) instead of using AbstractDelta.getType() so I cannot subclass AbstractDelta myself.

Probably the easiest way to resolve this is to add an abstract withChunks(Chunk<T> original, Chunk<T> revised) method to AbstractDelta.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions