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

Fix parameterized return types in StreamMatchers #7

Merged
merged 4 commits into from
Aug 1, 2020

Conversation

runeflobakk
Copy link
Contributor

Fixes return types for .equalTo, .contains, and .empty.

Duplicates unruly/java-8-matchers#22, which fixes unruly/java-8-matchers#18

This PR also fixes compile issues from Java 9 and later, see c973640

facboy and others added 4 commits July 29, 2020 15:03
Return type is parameterized to yield a Matcher of the specific
Stream-type, instead of just Matcher<BaseStream<_, _>>.
See unruly/java-8-matchers#18 for more
detailed discussion.
This is peculiar. It seems the type inference through multiple levels of
method invokations is better with Java 8 than Java 11.

Anyway, the outermost is(..) invocation is redundant (and in my opinion
also decreases readability), so they are removed to make the code
compile on Java 11.
@runeflobakk
Copy link
Contributor Author

@mrwilson As c973640 fixes the build on OpenJDK 9 and 11 (https://travis-ci.org/github/mrwilson/java-8-matchers/builds/712914543), I suggest we also remove the allow_failures from .travis.yml. I.e. this section: https://github.com/mrwilson/java-8-matchers/blob/master/.travis.yml#L7-L10. I can add a commit to this PR to remove the section.

@runeflobakk
Copy link
Contributor Author

I believe these changes are supposed to be backwards compatible. Did a small check with japicmp and the report did not show any breaking API-changes.

@runeflobakk runeflobakk mentioned this pull request Jul 30, 2020
@mrwilson mrwilson merged commit 6cdfc36 into mrwilson:master Aug 1, 2020
@mrwilson
Copy link
Owner

mrwilson commented Aug 1, 2020

I'll do a 1.9 release this weekend 👍

@runeflobakk runeflobakk deleted the fix-equalto-types branch August 3, 2020 10:42
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

Successfully merging this pull request may close these issues.

StreamMatchers.empty() and StreamMatchers.equalTo() return Matcher<BaseStream<T, S>>
3 participants