I realize the issue of generic type conflicts has been successfully confronted many times over on this site, and the advice given has helped me in the past, but in this case, I cannot seem to determine the source of the conflict.
The first declaration in my Graph class is giving me an error:
error: type argument Vertex<T#1> is not within bounds of type-variable T#2
private AVLTree<Vertex<T>> vertices;
^
where T#1,T#2 are type-variables:
T#1 extends Comparable<T#1> declared in class Graph
T#2 extends Comparable<T#2> declared in class AVLTree
Here is the Graph class declaration and the problematic field:
public class Graph<T extends Comparable<T>> implements GraphInterface<T> {
private AVLTree<Vertex<T>> vertices;
...
// implemented methods, etc.
...
}
AVLTree class declaration:
public class AVLTree<T extends Comparable<T>> { ... }
And the Vertex class declaration:
public class Vertex<T extends Comparable<T>> implements Comparable<Vertex> { ... }
I don't see what's wrong here. Any ideas?