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

Bug 242523

Summary: GraphViewer#findGraphItem(object) throws ArrayIndexOutOfBoundsException instead of returning null
Product: [Tools] GEF Reporter: David Savage <david.savage>
Component: GEF-Legacy ZestAssignee: Ian Bull <irbull>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description David Savage CLA 2008-07-30 04:57:33 EDT
The code within findGraphItem does the following:

public GraphItem findGraphItem(Object element) {
	Widget[] result = findItems(element);
	return (result.length == 0 && result[0] instanceof GraphItem) ? null : (GraphItem) result[0];
}

this should be:

return (result.length == 0 || !(result[0] instanceof GraphItem)) ? null : (GraphItem) result[0];
Comment 1 Ian Bull CLA 2008-11-25 12:58:42 EST
looks as if this was fixed.    I think I did this with a few other fixes earlier this month.

Thanks for pointing ths out.