Bug 46060 - regression - content assist fails to present proposal
Summary: regression - content assist fails to present proposal
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.0 M6   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-04 15:36 EST by Randy Hudson CLA
Modified: 2003-12-16 10:47 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Hudson CLA 2003-11-04 15:36:27 EST
In the class LogicDiagramEditPart, which extends a class which implements a 
method defined on an interface which is implemented in the superclass, I am 
trying to extend that method:

public Object getAdapter(Class adapter) {
	if (adapter == SnapToHelper.class)
		return new SnapToHelper() {
			public Point getSnappedDragDelta(Point raw) {
				return null;
			}
		};
	return super.getA<<CARET>>;
}

When content assist is invoked at the caret, "getAdapter(Class)" should be 
proposed but isn't.
Comment 1 David Audel CLA 2003-11-27 09:57:07 EST
I can not repruduce the problem but i am not sure to have understood your test 
case.

Is it the following test case ?

public class LogicDiagramEditPart extends Y {
  public Object getAdapter(Class adapter){
    if (adapter == SnapToHelper.class)
      return new SnapToHelper() {
        Point getSnappedDragDelta(Point raw) {
          return null;
        }
      };
      return super.getA
  }
}
public class Y implements I {
  public Object getAdapter(Class adapter){return null}
}
public intertace I {
  public Object getAdapter(Class adapter);
}
Comment 2 Randy Hudson CLA 2003-11-28 14:31:07 EST
There are several superclasses between Y and LogicDiagramEditPart. And of 
course, lots of more methods and stuff.

Our code is available in the same CVS repository as eclipse, but under 
the "tools" path.
Comment 3 Randy Hudson CLA 2003-12-01 19:30:47 EST
I'm going to try to reproduce this in someone else's workspace.  He already has 
GEF loaded.  If it is reproduceable there, could you try checking-out:
 - org.eclipse.draw2d
 - org.eclipse.gef
 - org.eclipse.gef.examples.logic
from /home/tools on eclipse.org?
Comment 4 Pratik Shah CLA 2003-12-01 19:47:19 EST
I was able to reproduce it.
Comment 5 Pratik Shah CLA 2003-12-01 20:02:12 EST
Another example of the same problem (although a slightly different case): 
RulerEditPart (also in GEF) has an anonymous inner class in its getDragTracker
() method.  Code completion does not work for super.mouseDown() in the mouseDown
() method of this anonymous inner class (SimpleDragTracker).
Comment 6 Randy Hudson CLA 2003-12-02 09:54:06 EST
Works in 2.1
Comment 7 David Audel CLA 2003-12-03 06:03:25 EST
I can reproduce it. Thanks for the test case.

Simplest test case:
public class X extends Y {
  public void foo(){
    super.foo<cursor>
  }
}
public abstract class Y extends Z implements I {
}
public class Z implements I {
  public void foo(){}
}
public interface I {
  public void foo();
}
Comment 8 David Audel CLA 2003-12-04 07:00:05 EST
Fixed and test added (CompletionTests#testCompletionAfterSupercall1)
Comment 9 Frederic Fusier CLA 2003-12-16 10:47:51 EST
Verified with build I200312160010