Bug 171415 [Viewers] Table viewer needs to clear label, image when items are reused
If an item is reused for a different element on a refresh, the table viewer needs to clear the label and image from the item being reused. This is necessary to communicate to the label provider that a new label is needed (i.e. the label provider may defer providing a label if decorators are not ready). This is what the tree viewer does. To see the problem, open the Java Browsing perspective and select a Java project. Then click between different packages. Notice that some of the labels in the Types list take a while to update. Opening one of these reveals that the label is showing the wrong text.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTableViewer.java
public void notVisibleAdded(Object element, int index) {
			int requiredCount = doGetItemCount() + 1;
			Object[] newCache = new Object[requiredCount];
			System.arraycopy(cachedElements, 0, newCache, 0, index);
			if (index < cachedElements.length) {
				System.arraycopy(cachedElements, index, newCache, index + 1,
						cachedElements.length - index);
			}
			newCache[index] = element;
			cachedElements = newCache;
			doSetItemCount(requiredCount);
		}
		/**
		 * The elements with the given indices need to be removed from the
		 * cache.
		 * 
		 * @param indices
		 */
		public void removeIndices(int[] indices) {
			if (indices.length == 1) {
				removeIndicesFromTo(indices[0], indices[0]);
			}
			int requiredCount = doGetItemCount() - indices.length;
			Arrays.sort(indices);
			Object[] newCache = new Object[requiredCount];
			int indexInNewCache = 0;
			int nextToSkip = 0;
			for (int i = 0; i < cachedElements.length; i++) {
				if (nextToSkip < indices.length && i == indices[nextToSkip]) {
					nextToSkip++;