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

Generify the Comparable type in the Range class #478

Closed
asdm90 opened this issue Aug 18, 2022 · 2 comments
Closed

Generify the Comparable type in the Range class #478

asdm90 opened this issue Aug 18, 2022 · 2 comments
Milestone

Comments

@asdm90
Copy link

asdm90 commented Aug 18, 2022

The generic type declaration for the Range class can be improved with wildcards like so:

Current declaraction:
public final class Range<T extends Comparable> implements Serializable

Possible enhancement:
public final class Range<T extends Comparable<? super T>> implements Serializable

This should remove a couple of IDE warnings about the use of generics in the class and should be backwards compatible.

@vladmihalcea
Copy link
Owner

Since you already investigate it, you could send a Pull Request with a change proposal. I'll investigate it afterward.

@vladmihalcea vladmihalcea changed the title Enhancement - Use of generic type parameter in Range class Generify the Range class Sep 5, 2022
@vladmihalcea vladmihalcea changed the title Generify the Range class Generify the Comparable type in the Range class Sep 5, 2022
@vladmihalcea vladmihalcea added this to the 2.19.0 milestone Sep 5, 2022
@vladmihalcea
Copy link
Owner

Fixed.

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

No branches or pull requests

2 participants