Bug 65049 [Dialogs] NPE when creating folder during adding source folder while workspace is locked
3.0RC1 - start a job holding the workspace lock during the following steps (e.g., with the org.eclipse.ui.examples.job plugin) - open properties of a Java project - on the Java Build Path Source page click Add Folder - click Create New Folder - enter some name - click Ok - press cancel in the progress dialog -> the following exception is written to the log: java.lang.NullPointerException at org.eclipse.jdt.internal.ui.wizards.buildpaths.MultipleFolderSelectio nDialog.newFolderButtonPressed(MultipleFolderSelectionDialog.java:292) at org.eclipse.jdt.internal.ui.wizards.buildpaths.MultipleFolderSelectio nDialog$3.widgetSelected(MultipleFolderSelectionDialog.java:237) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java: 89) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2716) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2382) at org.eclipse.jface.window.Window.runEventLoop(Window.java:668) at org.eclipse.jface.window.Window.open(Window.java:648) at org.eclipse.jdt.internal.ui.wizards.buildpaths.SourceContainerWorkboo kPage.openSourceContainerDialog(SourceContainerWorkbookPage.java:586) at org.eclipse.jdt.internal.ui.wizards.buildpaths.SourceContainerWorkboo kPage.sourcePageCustomButtonPressed(SourceContainerWorkbookPage.java:273) at org.eclipse.jdt.internal.ui.wizards.buildpaths.SourceContainerWorkboo kPage$SourceContainerAdapter.customButtonPressed(SourceContainerWorkbookPage.jav a:191) at org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField. buttonPressed(TreeListDialogField.java:167) at org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField. doButtonSelected(TreeListDialogField.java:381) at org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField. access$2(TreeListDialogField.java:377) at org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField$ 2.widgetSelected(TreeListDialogField.java:344) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java: 89) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2716) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2382) at org.eclipse.jface.window.Window.runEventLoop(Window.java:668) at org.eclipse.jface.window.Window.open(Window.java:648) at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction. java:177) at org.eclipse.jface.action.Action.runWithEvent(Action.java:881) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:915) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContri butionItem.java:866) at org.eclipse.jface.action.ActionContributionItem$7.handleEvent(ActionC ontributionItem.java:785) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2716) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2382) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1363) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1334) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.jav a:253) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96 ) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformAct ivator.java:334) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:273) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:128) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:185) at org.eclipse.core.launcher.Main.run(Main.java:638) at org.eclipse.core.launcher.Main.main(Main.java:622) java.lang.NullPointerException
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/NewFolderDialog.java
}
    /**
     * Update the dialog's status line to reflect the given status. It is safe to call
     * this method before the dialog has been opened.
     */
    private void updateStatus(int severity, String message) {
        updateStatus(new Status(severity, IDEWorkbenchPlugin.getDefault()
                .getDescriptor().getUniqueIdentifier(), severity, message, null));
    }
    /**
     * Checks whether the folder name and link location are valid.
     *
     * @return null if the folder name and link location are valid.
     * 	a message that indicates the problem otherwise.
     */
    private void validateLinkedResource() {
        boolean valid = validateFolderName();
        if (valid) {
            IFolder linkHandle = createFolderHandle(folderNameField.getText());
            IStatus status = linkedResourceGroup
                    .validateLinkLocation(linkHandle);
            if (status.getSeverity() != IStatus.ERROR)
                getOkButton().setEnabled(true);
            else
                getOkButton().setEnabled(false);
            if (status.isOK() == false)
                updateStatus(status);
        } else
            getOkButton().setEnabled(false);
    }