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

Compile error on JDK 21: aQute/lib/collections/SortedList doesn't fully implement SortedSet/List interfaces #6131

Closed
neeshy opened this issue May 24, 2024 · 2 comments · Fixed by #6134

Comments

@neeshy
Copy link
Contributor

neeshy commented May 24, 2024

Due to conflicting default method implementations:

aQute.libg/src/aQute/lib/collections/SortedList.java:31: error: types List<T> and SortedSet<T> are incompatible;
public class SortedList<T> implements SortedSet<T>, List<T> {
       ^
  both define reversed(), but with unrelated return types
  where T is a type-variable:
    T extends Object declared in class SortedList

Should be as simple as implementing these methods:

T getFirst()
T getLast()
void addFirst(T e)
void addLast(T e)
T removeFirst()
T removeLast()
SortedList<T> reversed()
@pkriens
Copy link
Member

pkriens commented May 27, 2024

Can you provide a PR?

@neeshy
Copy link
Contributor Author

neeshy commented May 28, 2024

Sure: #6134

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 a pull request may close this issue.

2 participants