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
if (result == 0)
            return IDialogConstants.YES_ID;
        if (result == 1)
            return IDialogConstants.YES_TO_ALL_ID;
        if (result == 2)
            return IDialogConstants.NO_ID;
        return IDialogConstants.CANCEL_ID;
    }
    
    /**
     * Returns whether to ignore linked resources.
     * 
     * @return <code>true</code> to ignore linked resources, <code>false</code> to consider them
     * @since 3.1
     */
    public boolean getIgnoreLinkedResources() {
    	return ignoreLinkedResources;
    }
    /**
     * Sets whether to ignore linked resources.
     * The default is <code>false</code>.
     * 
     * @param ignore <code>true</code> to ignore linked resources, <code>false</code> to consider them
     * @since 3.1
     */
    public void setIgnoreLinkedResources(boolean ignore) {
    	ignoreLinkedResources = ignore;
    }
}