Community
Participate
Working Groups
Build ID: M20070921-1145 Steps To Reproduce: Create a project with the following classes in the same package: A.java: import java.util.Collection; public abstract class A <T extends A<T,S>,S extends Collection<T>> {} B.java: import java.util.Collection; public abstract class B extends A<D,Collection<D>> { boolean isD() {return this instanceof D;} } C.java: public abstract class C extends B { boolean isD() {return this instanceof D;} } D.java: public final class D extends C {} In class C, "this instanceof D" will be underlined in red with the message "Incompatible conditional operand types C and D". However, no errors are indicated otherwise, such as in the Problems view. Also, the same code in class B is not marked as an error. More information: Probably occurs in combination with bug 214191, which seems similar to bug 35899.
I cannot reproduce using 3.4M4, but I could not identify which bug fix solved this problem. So, close as WORKSFORME for now
The "Incompatible conditional operand types" error is a side effect of the first "The hierarchy of the type C is inconsistent" error. This first error has been fixed by the fix for bug 205235.
*** This bug has been marked as a duplicate of bug 205235 ***
I could not find any test case reflecting this one in the tests. Is there one? A manual test case passes with build I20080204-0010.
Released Java50Tests#testHierarchyCycleInstanceof in HEAD. Verified for 34M5 using I20080204-0010 build.