Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311146

Summary: [code assist] Autocast after instanceof feature doesnt work when completion is in a binary expression
Product: [Eclipse Project] JDT Reporter: Ayushman Jain <amj87.iitr>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Ayushman Jain CLA 2010-04-30 05:19:25 EDT
Build Identifier: I20100129-1300

Bug 304006 was originally opened to deal with problems in autocast after instanceof keyword. This bug is being opened to handle case (2) reported in bug 304006 to avoid bloating the fix for 304006 with too many cases. So this bug report pertains to 

"2) It doesnt work when used in conjunction with binary expressions ( ==, != ,
&&, ||, &, | ) , viz.

class X {
   void methodFromX(){}
   void foo(Object a){
      int i = 1;
      if(a instanceof X){
         if(i == 1 && a.[CTRL-SPACE]) {
             // EXPECTED PROPOSAL : methodFromX, and if accepted also a cast to
X
             // However, we dont get this currently
         }
       }
    }
}
We can change the && with any other binary expression in the above code, and we
still dont get the required proposal." (Quoting from bug 304006).



Reproducible: Always

Steps to Reproduce:
1.Use the above source
2.Press CTRL-SPACE where indicated
3.See that no proposals from the class X are shown.