-
Notifications
You must be signed in to change notification settings - Fork 1
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
Deprecate methods with same name as in org.hamcrest.Matchers #8
Comments
Merged
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A slight annoyance when I use java-8-matchers is that quite often I also use matchers from
org.hamcrest.Matchers
. As I use static imports for matchers to make asserts easier to read, there will often be name clashes with matchers from Hamcrest, and I have to choose which one I want to static import.For example, in a test class asserting both streams and lists being empty:
Since there is a 2.0 release coming up, how would you feel about deprecating the methods in
StreamMatchers
andOptionalMatchers
having same names as methods inorg.hamcrest.Matchers
, and introduce new methods for the ones being deprecated? For instance, in the case ofStreamMatchers.empty()
, this could be solved with something like this:Other candidates include:
Other methods, which does not necessarily clash with methods in org.hamcrest.Matchers may also need to be renamed (deprecated, and new method introduced) to be consistent with new names, e.g. OptionalMatchers.emptyInt().
I can prepare such a pull-request, but I wanted to run this by you first to have your thoughts on the matter. A new major release presents an opportunity to revise the parts of the API which maybe should be changed.
As #5 is really just about internals, it is not necessary to do a release immediately after merging it. One possibility is to introduce a
v2
-branch or something, which functions as the mainline-branch for an upcoming 2.0.0-release, and eventually merge that one into the master branch when actually releasing v2.0.0.The text was updated successfully, but these errors were encountered: