Bug 313697 [Forms] Wrong code in org.eclipse.ui.forms.widgets.SizeCache
Build Identifier: 20100218-1602 package org.eclipse.ui.forms.widgets; import java.util.List; // should be org.eclipse.swt.widgets.List ............ static boolean independentLengthAndWidth(Control control) { if (control == null || control.isDisposed()) { return true; } if (control instanceof Button || control instanceof ProgressBar || control instanceof Sash || control instanceof Scale || control instanceof Slider || control instanceof List /*** here used List ***/ || control instanceof Combo || control instanceof Tree) { return true; } if (control instanceof Label || control instanceof Text) { return (control.getStyle() & SWT.WRAP) == 0; } // Unless we're certain that the control has this property, we should // return false. return false; } Reproducible: Always Steps to Reproduce: ...
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/SizeCache.java
* even flush the cache) if this is the same control as last time. 
     * 
     * @param newControl the control whose size is being cached, or null to always return (0,0)
     */
    public void setControl(Control newControl) {
        if (newControl != control) {
            control = newControl;
            if (control == null) {
                independentDimensions = true;
                preferredWidthOrLargerIsMinimumHeight = false;
                widthAdjustment = 0;
                heightAdjustment = 0;
            } else {
                independentDimensions = independentLengthAndWidth(control);
                preferredWidthOrLargerIsMinimumHeight = isPreferredWidthMaximum(control);
                computeHintOffset(control);
                flush();
            }
        }
    }
    /**
     * Returns the control whose size is being cached
     * 
     * @return the control whose size is being cached, or null if this cache always returns (0,0)
     */
    public Control getControl() {
        return control;
    }
    /**
     * Flush the cache (should be called if the control's contents may have changed since the