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

comparator method don't accept all possible comparable objects #328

Open
bjrke opened this issue Feb 11, 2021 · 0 comments
Open

comparator method don't accept all possible comparable objects #328

bjrke opened this issue Feb 11, 2021 · 0 comments

Comments

@bjrke
Copy link

bjrke commented Feb 11, 2021

https://avro.apache.org/ for example creates classes which implement Comparable<SpecificRecord> but not Comparable<ClassName>.
Instead every avro class extends SpecificRecordBase which also contains the implementation of compareTo.
Because of this its not easy to use matchers like lessThan.

A solution is to replace Comparable<T> with Comparable<? super T> like I did in my PR #327

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

No branches or pull requests

1 participant