Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 126276 - [Viewers] Stack overflow if getElements returns the same object as inputElement
Summary: [Viewers] Stack overflow if getElements returns the same object as inputElement
Status: CLOSED DUPLICATE of bug 9262
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1.2   Edit
Hardware: PC Windows XP
: P3 trivial (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact: Hitesh CLA
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2006-02-02 16:42 EST by Alex Chapiro CLA
Modified: 2010-08-10 04:45 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***