Oracle JDK and Eclipse JDT compilers disagree! Which is compiling this incorrectly? Unusual generics and inferrence
I have a piece of code which is compiling inconsistently between Oracle JDK 7 and Eclipse JDT 7, but since I'm not sure about which compiler is making the mistake(s) I thought I should ask for opinions here before submitting any bug reports. This is the simplest test I could come up with to demonstrate the inconsistency: interface Foo<S extends Foo<S, T>, T> { // should this compile? public <X extends Foo<S, Y>, Y> Y method1(); // what about this? public <X extends Foo<? extends S, Y>, Y> Y method2(); } Oracle JDK gives an error on method1 but not method2, whereas Eclipse has no problem with