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

Bug 344550

Summary: Wrong code assist when overriding
Product: [Eclipse Project] JDT Reporter: Mauro Molinari <mauromol>
Component: CoreAssignee: Stephan Herrmann <stephan.herrmann>
Status: CLOSED WORKSFORME QA Contact:
Severity: major    
Priority: P3 CC: anchakrk, srikanth_sankaran, stephan.herrmann
Version: 3.6.2   
Target Milestone: 4.14   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mauro Molinari CLA 2011-05-03 06:18:53 EDT
STEPS TO REPRO:
1. write the following classes:

###
package a;

import c.C;

public interface I
{
	<T> T getSomething(C<T> c);

	<T> void setSomething(C<T> c, T v);
}
###
package c;

public interface C<T>
{
}
###
package a.b;

import a.I;

public class A implements I
{
  set|
}

2. go to | and invoke code assist to override I.setSomething

EXPECTED RESULT:

package a.b;

import a.I;
import c.C;

public class A implements I
{
	@Override
	public <T> void setSomething(C<T> c, T v)
	{
		// TODO Stub di metodo generato automaticamente
	}
}

ACTUAL RESULT:

package a.b;

import a.I;

public class A implements I
{
	public <T> void setSomething(c.C<a.T> c, a.T v) {};
}

Please note:
1) the missing @Override annotation
2) the missing method body stub
3) the trailing ";"
4) the notation a.T which is invalid
5) the missing import c.C and the useless fully-qualified use of c.C within the method parameter declaration
Comment 1 Srikanth Sankaran CLA 2011-05-03 11:18:40 EDT
Ayush, please follow up.
Comment 2 Eclipse Genie CLA 2020-03-19 14:22:48 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.
Comment 3 Mauro Molinari CLA 2020-03-20 04:57:38 EDT
This indeed works well in 2019-12.