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

Bug 206056

Summary: Code completion with instanceof and generic classes
Product: [Eclipse Project] JDT Reporter: Mauro Molinari <mauromol>
Component: CoreAssignee: Ayushman Jain <amj87.iitr>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: jerome_lanneluc, joerg, srikanth_sankaran
Version: 3.3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard: stalebug

Description Mauro Molinari CLA 2007-10-11 12:08:28 EDT
Build ID: M20070921-1145

Steps To Reproduce:
1. Try to write the following:

public class AB<T>
{
 public void a()
 {
   AB<Object> a = new AB<Object>();
   if(a instanceof A <= invoke code completion here!);
 }
}

OBSERVED RESULT:

public class AB<T>
{
 public void a()
 {
   AB<Object> a = new AB<Object>();
   if(a instanceof AB<Object>); <= COMPILER ERROR!
 }
}

EXPECTED BEHAVIOUR:

public class AB<T>
{
 public void a()
 {
   AB<Object> a = new AB<Object>();
   if(a instanceof AB);
 }
}

In other words, if I am inside an instanceof and I'm testing on a generic class, the content assist should give me just the name of the class, without any generic parameters.
Comment 1 Joerg Hohwiller CLA 2009-10-11 17:02:28 EDT
I agree with you, Mauro. 
Please note that afterwards you will get a warning because of bug #252120
So one could consider if the corrent suggestion would be AB<?>.
(I personally still disagree with what happend in bug #252120)
Comment 2 Mauro Molinari CLA 2009-10-13 03:46:37 EDT
(In reply to comment #1)
> (I personally still disagree with what happend in bug #252120)

My point of view on this is described in bug #259378 comment #3 and bug #282141 comment #5.
Personally, I agree with you.
Comment 3 Srikanth Sankaran CLA 2010-05-13 07:53:12 EDT
Ayush, please follow up, pass on to UI as needed.
Comment 4 Eclipse Genie CLA 2019-10-21 14:59:52 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.