Skip to content

changePosition NULL on UnifiedDiffReader.parseUnifiedDiff #117

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

Closed
elanzini opened this issue Mar 11, 2021 · 4 comments
Closed

changePosition NULL on UnifiedDiffReader.parseUnifiedDiff #117

elanzini opened this issue Mar 11, 2021 · 4 comments

Comments

@elanzini
Copy link

I was testing the tool and I picked a random commit from this repo to do so. Let's take 5338313. I accessed the diff of it by adding a .diff at the end of the URL and saved it into diff.txt file. I then used the tool to parse it in the following way:

public static void main(String[] args) throws IOException {
    var stream = new FileInputStream(new File("/path/to/diff.txt"));
    var patch  = UnifiedDiffReader.parseUnifiedDiff(stream);

    patch.getFiles().forEach(f -> {
        System.out.println("File: " + f.getFromFile());
        f.getPatch().getDeltas().forEach(delta -> {

            System.out.println("Source: ");
            System.out.println(delta.getSource().getPosition());
            delta.getSource().getChangePosition().forEach(System.out::print);

            System.out.println("Target: ");
            System.out.println(delta.getTarget().getPosition());
            delta.getTarget().getChangePosition().forEach(System.out::print);
        });
    });
}

The delta getChangePosition is just null. Am I doing something wrong?

@wumpz
Copy link
Collaborator

wumpz commented Mar 14, 2021

Indeed this is missing. It was added into the old parser while the new one was already in progress. I am on it.

@wumpz wumpz closed this as completed in 2a1239b Mar 14, 2021
wumpz added a commit that referenced this issue Mar 14, 2021
@elanzini
Copy link
Author

@wumpz any eta on when 4.10 will be released? looking forward to it!

@wumpz
Copy link
Collaborator

wumpz commented Apr 28, 2021 via email

@wumpz
Copy link
Collaborator

wumpz commented Apr 28, 2021 via email

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

No branches or pull requests

2 participants