Skip to content
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

Stop appendReplacement from throwing an exception when a replacement group is null. #13

Merged
merged 1 commit into from
Oct 21, 2015

Conversation

jkadams
Copy link
Contributor

@jkadams jkadams commented Oct 6, 2015

See bug 24605755.

@jkadams
Copy link
Contributor Author

jkadams commented Oct 21, 2015

In that case, start and end both return -1:
http://docs.oracle.com/javase/7/docs/api/java/util/regex/Matcher.html#start(int)
"or -1 if the match was successful but the group itself did not match anything"

Tested with java.util.regex.Matcher, and start/end both return -1 and group returns null, so this is fine the way it is - the only bug is in appendReplacement.

alandonovan pushed a commit that referenced this pull request Oct 21, 2015
Stop appendReplacement from throwing an exception when a replacement group is null.
@alandonovan alandonovan merged commit da74886 into google:master Oct 21, 2015
@alandonovan
Copy link
Contributor

Thanks for checking.

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

Successfully merging this pull request may close these issues.

4 participants