Bug 74059 [Viewers] ViewerLabel#hasNewImage() is wrong when setImage(..) has not been called
I200409140800 The Javadoc of ViewerLabel#hasNewImage() states: @return boolean. <code>true</code> if the image has been set to something new. But the current implementation also returns true when 'startImage' is != null, and setImage(..) has not been called. A fix could be to set 'newImage' to 'initialImage' in the constructor, and then update getImage() to just return newImage. For clients that use the pattern ... if (updateLabel.hasNewImage()) item.setImage(updateLabel.getImage()); ..., the current implementation makes them call Item#setImage(..) too often. The same problem applies to hasNewText().
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ViewerLabel.java
/*******************************************************************************
 * Copyright (c) 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jface.viewers;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
/**
 * The ViewerLabel is the class that is passed to a viewer to handle updates of
 * labels. It keeps track of both original and updates text.
 * 
 * @see IViewerLabelProvider
 * @since 3.0
 */
public class ViewerLabel {
	
	private String newText = null;
	private Image newImage = null;