Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311625

Summary: Problem with introducing property page without filter
Product: [Modeling] OCL Reporter: Lidija Grahek <lgrahek>
Component: CoreAssignee: OCL Inbox <mdt-ocl-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: ahunter.eclipse, ed
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Lidija Grahek CLA 2010-05-04 16:29:00 EDT
As part of bugzilla https://bugs.eclipse.org/bugs/show_bug.cgi?id=289761, a property page was introduced without any filter or enablement expression - see org.eclipse.ocl.examples.modelregistry.ui/plugin.xml under extension point="org.eclipse.ui.propertyPages". It means that this property page is considered a valid one by Eclipse's properties action for all elemements, which results in Eclipse's Properties context menu entry being available everywhere. When clicking on Properties option for an element that shouldn't have it (but now it does because of this defect) an exception is shown and partially initiated property dialog is opened.

I marked this defect with severety normal, but could very well be major considering that it is a regression.
Comment 1 Ed Willink CLA 2010-05-04 17:26:22 EDT

*** This bug has been marked as a duplicate of bug 308601 ***
Comment 2 Lidija Grahek CLA 2010-05-05 10:33:49 EDT
Thank you Edward for a quick response. I tried out the patch you committed yesterday. Adding check for IResource did help remove Properties option from irrelevant elements.

There seems to be another restriction though that should take place. Namely, when I open OCL Model Registry property page on a project element (that does adapt to IResource), I get the exception as shown below. I assume we can keep bug 308601 closed, and this one opened then. Or maybe keep this closed and create a new defect?

Also, I noticed that you rolled back your change that checks for IResource soon after delivering it. I assume you will put it back in? It does solve the major part of this problem.

Thanks!

-----------------------------
org.eclipse.core.internal.resources.ResourceException: Resource '/my project name/.settings/org.eclipse.ocl.modelregistry' does not exist.
	at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:326)
	at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:200)
	at org.eclipse.core.internal.resources.File.getContents(File.java:291)
	at org.eclipse.core.internal.resources.File.getContents(File.java:282)
	at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl$WorkbenchHelper.createPlatformResourceInputStream(PlatformResourceURIHandlerImpl.java:204)
	at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createInputStream(PlatformResourceURIHandlerImpl.java:448)
	at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:301)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1254)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:255)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:270)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397)
	at org.eclipse.ocl.examples.modelregistry.model.ProjectRegistry.loadModel(ProjectRegistry.java:249)
	at org.eclipse.ocl.examples.modelregistry.ui.properties.ConfigurationBlock.<init>(ConfigurationBlock.java:169)
	at org.eclipse.ocl.examples.modelregistry.ui.properties.PropertyPage.createControl(PropertyPage.java:137)
	at org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1501)

.....


And there is another error, the same stack as this but error message

org.eclipse.core.internal.resources.ResourceException: Resource '/my project name/.settings/org.eclipse.qvt.declarative.modelregistry' does not exist.
Comment 3 Ed Willink CLA 2010-05-05 11:30:21 EDT
I'm afraid that I had to roll-back the commit to try to find out why Hudson builds started to fail from this fix and five other trivial changes. (Bug 311658). I'll recommit once the nightmare is over.

On bug 308601 I asked for an example of a non-IResource but received no assistance in providing a repro. I could only test by temporarily adpting to IFile and verifying the selectivity.
Comment 4 Ed Willink CLA 2010-06-18 16:08:20 EDT
In the absence of any further test case.
Comment 5 Ed Willink CLA 2011-05-27 03:01:46 EDT
Closing WORKSFORME