Thanks to visit codestin.com
Credit goes to github.com

Skip to content

UnifiedDiffParserException on apparently sane file (3rd variant) #110

Closed
@moio

Description

@moio

Describe the bug
UnifiedDiffReader.parseUnifiedDiff throws UnifiedDiffParserException on a patch which apparently looks good:

https://git.centos.org/rpms/avahi/raw/c8/f/SOURCES/0001-avahi-python-Use-the-agnostic-DBM-interface.patch

To Reproduce
Run this program: https://gist.github.com/moio/18c8452246bc46a8b6e36c1719c0f831

(contains the literal patch as a string)

Expected behavior

No Exceptions.

Actual behavior

Dec 21, 2020 10:12:32 AM com.github.difflib.unifieddiff.UnifiedDiffReader processLine
WARNING:   >>> no rule matched similarity index 87%
Exception in thread "main" com.github.difflib.unifieddiff.UnifiedDiffParserException: expected file start line not found
	at com.github.difflib.unifieddiff.UnifiedDiffReader.parse(UnifiedDiffReader.java:95)
	at com.github.difflib.unifieddiff.UnifiedDiffReader.parseUnifiedDiff(UnifiedDiffReader.java:151)

System

  • Java version: openjdk-11
  • Version: 4.9

Notes

👋 java-diff-utils maintainers! Here's the third one. I might produce even more going forward, please bear with me :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions