Bug 107377 [GlobalActions] NPE deleting a file
I got an NPE when I tried to delete a file from the synchronize view. The delete in Eclipse may have coincided with a delete of the file in the file system as it was a temp file from an application that was closing at the time I deleted the file in Eclipse. java.lang.NullPointerException at org.eclipse.ui.actions.ReadOnlyStateChecker.checkReadOnlyResources (ReadOnlyStateChecker.java:154) at org.eclipse.ui.actions.ReadOnlyStateChecker.checkReadOnlyResources (ReadOnlyStateChecker.java:108) at org.eclipse.ui.actions.DeleteResourceAction.getResourcesToDelete (DeleteResourceAction.java:551) at org.eclipse.ui.actions.DeleteResourceAction.run (DeleteResourceAction.java:492) at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent (BaseSelectionListenerAction.java:167) at org.eclipse.ui.actions.RetargetAction.runWithEvent(RetargetAction.java:222) at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:117) at org.eclipse.core.commands.Command.execute(Command.java:311) at org.eclipse.core.commands.ParameterizedCommand.execute (ParameterizedCommand.java:396) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand (WorkbenchKeyboard.java:459) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press (WorkbenchKeyboard.java:781) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent (WorkbenchKeyboard.java:828) at org.eclipse.ui.internal.keys.OutOfOrderListener.handleEvent (OutOfOrderListener.java:76) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:883) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:907) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:892) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:920) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:916) at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1515) at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:3376) at org.eclipse.swt.widgets.Tree.WM_KEYDOWN(Tree.java:3052) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3087) at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:2908) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3772) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1680) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2763) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1734) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1698) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:338) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/ReadOnlyStateChecker.java
private Shell shell;
    private String titleMessage;
    private String mainMessage;
    private boolean yesToAllSelected = false;
    private boolean cancelSelected = false;
    private boolean ignoreLinkedResources = false;
    
    private String READ_ONLY_EXCEPTION_MESSAGE = IDEWorkbenchMessages.ReadOnlyCheck_problems;
    /**
     * Create a new checker that parents the dialog off of parent using the supplied
     * title and message.
     * @param parent the shell used for dialogs
     * @param title the title for dialogs
     * @param message the message for a dialog - this will be prefaced with the name of the resource.
     */
    public ReadOnlyStateChecker(Shell parent, String title, String message) {
        this.shell = parent;
        this.titleMessage = title;
        this.mainMessage = message;
    }
    /**
     * Check an individual resource to see if it passed the read only query. If it is a file
     * just add it, otherwise it is a container and the children need to be checked too.
     * Return true if all items are selected and false if any are skipped.
     */