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
cancelButton = createCancelButton(parent);
    }
    /**
     * Creates the Cancel button for this wizard dialog.
     * Creates a standard (<code>SWT.PUSH</code>) button and registers for its
     * selection events. Note that the number of columns in the button bar composite
     * is incremented. The Cancel button is created specially to give it a 
     * removeable listener.
     *
     * @param parent the parent button bar
     * @return the new Cancel button
     */
    private Button createCancelButton(Composite parent) {
        
        ((GridLayout) parent.getLayout()).numColumns++;
        Button button = new Button(parent, SWT.PUSH);
        button.setText(IDialogConstants.CANCEL_LABEL);
        setButtonLayoutData(button);
        button.setFont(parent.getFont());
        button.setData(new Integer(IDialogConstants.CANCEL_ID));
        button.addSelectionListener(cancelListener);
        return button;
    }
    /**
     * Return the cancel button if the id is a the cancel id.
     * @param id the button id
     * @return the button corresponding to the button id
     */
    protected Button getButton(int id) {
        if (id == IDialogConstants.CANCEL_ID)