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

Bug 245962

Summary: SWTEventDispatcher.updateHoverSource uses Figure instead of IFigure
Product: [Tools] GEF Reporter: sudhan <sudhan>
Component: GEF-Legacy Draw2dAssignee: Anthony Hunter <ahunter.eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: ahunter.eclipse, hudsonr, kuhn
Version: 3.4   
Target Milestone: 3.5.0 (Galileo) M5   
Hardware: PC   
OS: Linux   
Whiteboard:

Description sudhan CLA 2008-09-02 09:32:59 EDT
+++ This bug was initially created as a clone of Bug #218863 +++

Build ID: M20071023-1652

Steps To Reproduce:
org.eclipse.draw2d.SWTEventDispatcher.updateFigureUnderCursor() uses Figure instead of IFigure, i am getting a class cast exception because of this. 

Line of code:
if ((Figure)cursorTarget != hoverSource)


More information:
I know I shouldnt implement the IFigure interface by myself but there seems to be no reason why a cast is made to Figure in the line above- its just checking reference equality- there should not be any cast in the line at all right?
Comment 1 Anthony Hunter CLA 2009-01-23 16:36:52 EST
(In reply to comment #0)
> 
> Line of code:
> if ((Figure)cursorTarget != hoverSource)
> 
> 

Agreed on this one, especially since both are IFigure.

private IFigure cursorTarget;
private IFigure hoverSource;

Committed to HEAD.
Comment 2 Anthony Hunter CLA 2009-01-23 16:37:15 EST
Committed to HEAD.
Comment 3 sudhan CLA 2009-01-28 23:35:58 EST
(In reply to comment #2)
> Committed to HEAD.
> 
Thanks Anthony