Bug 89504 [Contributions] ResourceException when opening context menu on closed project
I20050329-2000 Close a project and the open the context menu on it. I guess the problem is that org.eclipse.ui.internal.ide.model.ProjectPersistentPropertyTester accesses a closed project. Error 2005-03-30 12:42:44.675 Core exception while testing project persistent property org.eclipse.core.internal.resources.ResourceException: Resource /org.eclipse.jface.text.tests is not open. at org.eclipse.core.internal.resources.Project.checkAccessible(Project.java:127) at org.eclipse.core.internal.resources.Resource.getPersistentProperty(Resource.java:924) at org.eclipse.ui.internal.ide.model.ProjectPersistentPropertyTester.test(ProjectPersistentPropertyTester.java:68) at org.eclipse.core.internal.expressions.Property.test(Property.java:52) at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:57) at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:47) at org.eclipse.core.internal.expressions.AdaptExpression.evaluate(AdaptExpression.java:58) at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:47) at org.eclipse.core.internal.expressions.EnablementExpression.evaluate(EnablementExpression.java:29) at org.eclipse.ui.internal.ObjectActionContributor$ObjectContribution.isApplicableTo(ObjectActionContributor.java:337) at org.eclipse.ui.internal.ObjectActionContributor.isApplicableTo(ObjectActionContributor.java:208) at org.eclipse.ui.internal.ObjectContributorManager.isApplicableTo(ObjectContributorManager.java:274) at org.eclipse.ui.internal.ObjectActionContributorManager.contributeObjectActions(ObjectActionContributorManager.java:124) at org.eclipse.ui.internal.PopupMenuExtender.addObjectActions(PopupMenuExtender.java:201) at org.eclipse.ui.internal.PopupMenuExtender.menuAboutToShow(PopupMenuExtender.java:226) at org.eclipse.jface.action.MenuManager.fireAboutToShow(MenuManager.java:285) at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:372) at org.eclipse.jface.action.MenuManager.access$0(MenuManager.java:369) at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:386) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:116) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:866) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:847) at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:3327) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3055) at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1493) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3466) at org.eclipse.swt.internal.win32.OS.TrackPopupMenu(Native Method) at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:225) at org.eclipse.swt.widgets.Display.runPopups(Display.java:2920) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2521) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1570) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1534) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:306) 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:228) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:338) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:151) 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:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:268) at org.eclipse.core.launcher.Main.basicRun(Main.java:260) at org.eclipse.core.launcher.Main.run(Main.java:887) at org.eclipse.core.launcher.Main.main(Main.java:871)
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/model/ProjectPersistentPropertyTester.java
private static final String ALLOW_UNSET_PROJECTS = "allowUnsetProjects";  
    
    private static final IActionFilter filter = new WorkbenchResource() {
        
    	/* (non-Javadoc)
    	 * @see org.eclipse.ui.internal.ide.model.WorkbenchResource#getBaseImage(org.eclipse.core.resources.IResource)
    	 */
    	protected ImageDescriptor getBaseImage(IResource resource) {
            return null;
        }
    };
    /* (non-Javadoc)
     * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
     */
    public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
        if (receiver instanceof ResourceMapping) {
            if (property.equals(IResourceActionFilter.PROJECT_PERSISTENT_PROPERTY)) {
                if(args == null) return false;