Bug 82706 [Wizards] WizardDialog: code inconsistent
As long as WizardDialog.updateTitleBar() is a public method (should it be?) it's not a bad idea to check dialog state in all appropriate places. Now: public void updateTitleBar() { String s = null; if(currentPage != null) s = currentPage.getTitle(); if (s == null) s = ""; //$NON-NLS-1$ setTitle(s); if(currentPage != null) setTitleImage(currentPage.getImage()); updateDescriptionMessage(); updateMessage(); } It accurately checks that currentPage != null, but forgets to do the same before calling of updateDescriptionMessage() method wich works with currentPage without any checking. This can cause NPE (which happened to me :-)).
bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/WizardDialog.java
}
    /**
     * Calculates the difference in size between the given
     * page and the page container. A larger page results 
     * in a positive delta.
     *
     * @param page the page
     * @return the size difference encoded
     *   as a <code>new Point(deltaWidth,deltaHeight)</code>
     */
    private Point calculatePageSizeDelta(IWizardPage page) {
        Control pageControl = page.getControl();
        if (pageControl == null)
            
            return new Point(0, 0);
        Point contentSize = pageControl.computeSize(SWT.DEFAULT, SWT.DEFAULT,
                true);
        Rectangle rect = pageContainerLayout.getClientArea(pageContainer);
        Point containerSize = new Point(rect.width, rect.height);
        return new Point(Math.max(0, contentSize.x - containerSize.x), Math
                .max(0, contentSize.y - containerSize.y));
    }
    /* (non-Javadoc)
     * Method declared on Dialog.
     */
    protected void cancelPressed() {
        if (activeRunningOperations <= 0) {