Skip to content
This repository was archived by the owner on Jun 24, 2018. It is now read-only.

Using custom string equalizers during diff #1

Merged
merged 3 commits into from
May 22, 2014
Merged

Using custom string equalizers during diff #1

merged 3 commits into from
May 22, 2014

Conversation

andreaskumlehn
Copy link
Contributor

Added support to inject a custom Equalizer into the builder of the DiffRowGenerator.

This modification enabled us to use regexes during diff to ignore minor diffs while comparing lines of revisions.

}
return original.equals(revised);
}
};;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the creation of the default Equalizer from constructor of DiffRowGenerator to its builder

@KengoTODA KengoTODA self-assigned this May 18, 2014
@KengoTODA
Copy link
Owner

Thanks for your PR.

IMHO, it is better to:

@andreaskumlehn
Copy link
Contributor Author

Backwards compatibility is intact as I did not touch the publicly accessible methods.

About the nullness, I pushed a fix. I won't have time to create tests, sorry about that.

KengoTODA pushed a commit that referenced this pull request May 20, 2014
KengoTODA pushed a commit that referenced this pull request May 20, 2014
Now we have 2 classes which has to care about `ignoreWhiteSpace`
and here is 2 bugs:

1. it converts `null` to empty string
2. `Builder.ignoreWhiteSpace` doesn't work when we set custom
   Equalizer

This change solves these problem.
@KengoTODA
Copy link
Owner

Well, this change has one problem; there are 2 classes which is responsible to handle ignoreWhiteSpaces flag. Previously only Builder was responsible, but now both of Builder and custom Equalizer are responsible. And if you set custom Equalizer, Builder.ignoreWhiteSpaces doesn't work.

My suggestion is here, how do you think? I just remove this responsibility from Equalizer.

And, current your implementation converts null to empty string, but it breaks backward compatibility.

@andreaskumlehn
Copy link
Contributor Author

Looks good. Thanks for fixing it.

I did not have a look at the Nullable annotations as they were in place before my fix. Looks much better now.

@KengoTODA KengoTODA merged commit cf9a759 into KengoTODA:master May 22, 2014
KengoTODA pushed a commit that referenced this pull request May 22, 2014
@KengoTODA
Copy link
Owner

I've merged this branch to master. Thanks @andreaskumlehn.

You can download artifact from Maven central later. Its version is 1.5.0.

@KengoTODA
Copy link
Owner

@andreaskumlehn
Copy link
Contributor Author

Thanks a lot @eller86 :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants