Duplicate regex Matcher
Hi,
First of all, thanks for bringing this project back to life.
If I'm not mistaken there's a duplication in the regex matchers:
- MatchesPattern
- StringRegularExpression
There were none for such a long time and now there's two LOL I'm not complaining huh, but I think it would be wise to leave only one ;)
Cheers
More specifically, there are two ways to match regex in test code:
- org.hamcrest.Matchers.matchesRegex(regexString)
- org.hamcrest.text.MatchesPattern.matchesPattern(regexString)
They are semantically the same, and mostly similar in implementation.
Yes the classes do appear to be duplicates and cover very similar functionaility;
org.hamcrest.Matchers.matchesRegex(String) basically calls out to org.hamcrest.core.StringRegularExpression
org.hamcrest.core.StringRegularExpression
org.hamcrest.text.MatchesPattern
I also wonder about:
-
theInstance(T)vssameInstance(T) -
any(Class<T>)vsinstanceOf(Class<T>)
Also there is a general influx of badly-considered naming, documented here.