Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363625 - non-root-level items become corrupted when TreeColumn disposed
Summary: non-root-level items become corrupted when TreeColumn disposed
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.2   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-11 16:45 EST by Grant Gayed CLA
Modified: 2019-11-14 03:13 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grant Gayed CLA 2011-11-11 16:45:08 EST
- run the snippet below
- notice that all items identify their row and column indices
- after 5s the second column is disposed
- look at the resulting items in the second column
   -> the root-level items look fine (they all end in "column 2")
   -> however their child items are all wrong (they all end in "column 1")

public static void main(String[] args) {
    final Display display = new Display();
    Shell shell = new Shell(display);
    shell.setLayout(new FillLayout());

    final Tree tree = new Tree(shell, SWT.NONE);
    tree.setHeaderVisible(true);
    new TreeColumn(tree, SWT.NONE).setWidth(200);
    new TreeColumn(tree, SWT.NONE).setWidth(200);
    new TreeColumn(tree, SWT.NONE).setWidth(200);
    for (int i = 0; i < 9; i++) {
    	TreeItem root = new TreeItem(tree, SWT.NONE);
    	TreeItem item = new TreeItem(root, SWT.NONE);
    	for (int j = 0; j < 3; j++) {
    		root.setText(j, "root item " + i + " column " + j);
    		item.setText(j, "item " + i + " column " + j);
    	}
    	root.setExpanded(true);
    }
	display.timerExec(5000, new Runnable() {	
		public void run() {
			tree.getColumn(1).dispose();
		}
	});
	shell.pack();
    shell.open();
    while (!shell.isDisposed()) {
    	if (!display.readAndDispatch()) display.sleep();
    }
    display.dispose();
}
Comment 1 Lars Vogel CLA 2019-11-14 03:13:16 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.