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

Bug 126276

Summary: [Viewers] Stack overflow if getElements returns the same object as inputElement
Product: [Eclipse Project] Platform Reporter: Alex Chapiro <achapiro>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED DUPLICATE QA Contact: Hitesh <hsoliwal>
Severity: trivial    
Priority: P3 Keywords: helpwanted
Version: 3.1.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Alex Chapiro CLA 2006-02-02 16:42:10 EST
I see this problem in 3.1.1 using TreeViewer. 
My getElements looks like that:

		public Object[] getElements(Object inputElement) {
			if(null != inputElement)
				return new Object[] {inputElement};
			return new Object[0];
		}
It causes Stack Overflow. It's quite obvious why it happens. I haven't find out anything special in documentation about getElement requirement. So there can be at least two diferent conclusions:
a) It's an implementation bug.
b) It's not a bug, so it  should be documented.
Comment 1 Boris Bokowski CLA 2006-02-03 08:36:45 EST
This should be documented in StructuredViewer.
Comment 2 Alex Chapiro CLA 2006-02-03 08:49:31 EST
I don't think it should be a problem for TableViewer, shouldn't it? I guess it should be documented for TreeViewer only.
And the question: is it really inevitable limitation, or just the specific of the current implementation? It seems to me that it could be easily overcome. Of course user can also resolve the problem just embedding inputElement in a sort of trivial container. Could be the same implemented in TreeViewer?
Comment 3 Boris Bokowski CLA 2009-11-26 09:53:45 EST
Hitesh is now responsible for watching bugs in the [Viewers] component area.
Comment 4 Hitesh CLA 2010-08-10 04:45:16 EDT

*** This bug has been marked as a duplicate of bug 9262 ***