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

Bug 334617

Summary: [Profile Properties] Trying to unnapply a parent's profile throws an exception
Product: [Modeling] Papyrus Reporter: Vincent Hémery <vincent.hemery>
Component: ViewsAssignee: Camille Letavernier <cletavernier>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.10.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Vincent Hémery CLA 2011-01-18 05:34:50 EST
Apply a profile on a package

Select a child package.

Inspect the Profile properties tab.

Try and remove the profile which comes from the parent package.

The operation fails and the exception is available in the Error log :

org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IllegalArgumentException: org.eclipse.uml2.uml.internal.impl.ProfileImpl@1562036 (name: Ecore, visibility: <unset>))
	at org.eclipse.swt.SWT.error(SWT.java:4083)
	at org.eclipse.swt.SWT.error(SWT.java:3998)
	at ...
Caused by: java.lang.IllegalArgumentException: org.eclipse.uml2.uml.internal.impl.ProfileImpl@1562036 (name: Ecore, visibility: <unset>)
	at ... 23 more


The problem comes from the fact that the profile application is returned by the method org.eclipse.uml2.uml.Package.getAllAppliedProfiles() since it is applied on a parent package, but not by the method org.eclipse.uml2.uml.Package.getAppliedProfiles() since it is not applied directly on this package.

Either such profile applications should not appear in this tab, or they should be grayed with a warning message or a tooltip indicating they come from a parent package, and preventing them from being manipulated here.
Comment 1 Camille Letavernier CLA 2014-08-19 11:56:08 EDT
In the current version, the properties view only displays the profiles directly applied on the current package (i.e. getAppliedProfiles() instead of getAllAppliedProfiles()).

I close the task