← 返回首页
DeltaType always assigned as CHANGE in UnifiedDiff.parseUnifiedDiff(InputStream stream) · Issue #201 · java-diff-utils/java-diff-utils · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

DeltaType always assigned as CHANGE in UnifiedDiff.parseUnifiedDiff(InputStream stream) #201

New issue
New issue

Description

Good day everyone,

I am trying to wrap my head around the library, and this might be more of a question rather than a bug(?)...

When parsing unidiffs in this format:
https://github.com/java-diff-utils/java-diff-utils/blob/01a7fb16cfc33abc3e6ac4adcc2db79438f56fcf/java-diff-utils/src/test/resources/com/github/difflib/unifieddiff/jsqlparser_patch_1.diff

line 19 will be raised as change rather than insert:

The object created by parseUnifiedDiff() allows me to re-parse with DiffUtils.diff(delta.getSourceLines, delta.getTargetLines) to obtain the correct DeltaType (in this case INSERT, not CHANGE) but it obviously loses the line numbering (position):

  • original delta obtained by parseUnifiedDiff().getFiles().get(0).getPatch().getDeltas() -

  • re-parsed with DiffUtils.diff() -

Perhaps I am doing something wrong... but instinctively, shouldn't parseUnifiedDiff already assign the correct DeltaType?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    • Open in GitHub Copilot app

    Footer

    © 2026 GitHub, Inc.