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
* @param elementB
	 *            the second element
	 * @return whether elementA is equal to elementB
	 */
	protected boolean equals(Object elementA, Object elementB) {
		if (comparer == null) {
			return elementA == null ? elementB == null : elementA.equals(elementB);
		} else {
			return elementA == null ? elementB == null : comparer.equals(elementA, elementB);
		}
	}
	/**
	 * Returns the result of running the given elements through the filters.
	 * 
	 * @param elements
	 *            the elements to filter
	 * @return only the elements which all filters accept
	 */
	protected Object[] filter(Object[] elements) {
		if (filters != null) {
			ArrayList filtered = new ArrayList(elements.length);
			Object root = getRoot();
			for (int i = 0; i < elements.length; i++) {
				boolean add = true;
				for (int j = 0; j < filters.size(); j++) {
					add = ((ViewerFilter) filters.get(j)).select(this, root, elements[i]);
					if (!add) {
						break;
					}
				}