Bug 2677 - [Viewers] Performance: Viewer refresh need not setData or update map if elements identical (1GHWGFH)
Summary: [Viewers] Performance: Viewer refresh need not setData or update map if eleme...
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nick Edgar CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2001-10-10 22:41 EDT by Darin Swanson CLA
Modified: 2002-12-04 13:34 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Swanson CLA 2001-10-10 22:41:16 EDT
In TreeViewer.updateChildren,  there is the following code:

			if (newElement.equals(oldElement)) {
				// update the data to be the new element, since although the elements 
				// may be equal, they may still have different labels or children
				item.setData(newElement);
				mapElement(newElement, item);
			} 
			else {
				...
			}

If newElement == oldElement, this need not be done.

The new code should be:

			if (newElement == oldElement) {
				// don't need to update data or map when elements are identical
			} else if (newElement.equals(oldElement)) {
				// update the data to be the new element, since although the elements 
				// may be equal, they may still have different labels or children
				item.setData(newElement);
				mapElement(newElement, item);
			} else {
				...
			}

The same change should be made to TableViewer's refresh.

NOTES:
Comment 1 DJ Houghton CLA 2001-10-29 19:09:04 EST
PRODUCT VERSION:
128

Comment 2 Nick Edgar CLA 2002-12-04 13:34:34 EST
AbstractTreeViewer.updateChildren has had this check in since 2.0.