bndtools / bnd

Bnd/Bndtools. Tooling to build OSGi bundles including Eclipse, Maven, and Gradle plugins.
https://bndtools.org
Other
526 stars 304 forks source link

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

Closed neeshy closed 1 month ago

neeshy commented 1 month ago

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 commented 1 month ago

Can you provide a PR?

neeshy commented 1 month ago

Sure: #6134