Bug 98242 [Viewers] [Javadoc] clarify that StructuredViewer does not update sort order if null properties are given
Despite the specification of StructuredViewer.update(Object element, String[] properties) that specifiying null properties forces full update including sort order, the implementation in 3.1M6 calls internalUpdate() which inits needsRefilter to false if no properties are given. Thus a change to a relevant sort attribute of the element does not maintain sort order (e.g. on TreeViewer). Suggested fix: protected void internalUpdate(Widget widget, Object element, String[] properties) { boolean needsRefilter = true; if (properties != null) { needsRefilter = false; for (int i = 0; i < properties.length; ++i) { needsRefilter = needsRefilter(element,properties[i]);
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/StructuredViewer.java
/*******************************************************************************
 * Copyright (c) 2000, 2007 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     Tom Schindl - bug 151205
 *******************************************************************************/
package org.eclipse.jface.viewers;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.util.IOpenEventListener;
import org.eclipse.jface.util.OpenStrategy;
import org.eclipse.jface.util.SafeRunnable;