Community
Participate
Working Groups
According to 4.4, the extends part of a TypeVariable has to be a ClassOrInterfaceType (is not a TypeVariable). public class X<U, V extends U> {} should not compile. Using javac 1.5, this code compiles fine. If you add one more bound, it doesn't work anymore. public class X<U, V, W extends U&V> {} javac reports: X.java:1: a type variable may not be followed by other bounds Eclipse compiles both cases public class X<U, V, W extends U&V> {}
Actually with this case: public class X<U, V, W extends U&V> {} we report: 'The type V is not an interface; it cannot be specified as a bounded parameter' Since javac accepts this case: public class X<U, V extends U> {} I think we need to continue to accept it.