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

Bug 361380

Summary: profiling.ext: Profile application for Package is not supported
Product: [Modeling] M2T Reporter: Tatiana Fesenko <tatiana.fesenko>
Component: XpandAssignee: Karsten Thoms <karsten.thoms>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: karsten.thoms
Version: 1.1.0Flags: karsten.thoms: juno+
Target Milestone: M3   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Tatiana Fesenko CLA 2011-10-19 08:00:01 EDT
profiling.ext and org.eclipse.xtend.typesystem.uml2.profile.ProfilingExtensions#applyProfile() takes UML model only as a source of Profile Application. It's not possible ti use this utility to apply a profile to a package, while in UML Packages are also allowed to have profile applications.

The fix is trivial - replacing 
	public static Profile applyProfile (Model model, String uri) 
by
	public static Profile applyProfile (Package model, String uri) 

I am using Indigo and Xpand 1.1.1
Comment 1 Karsten Thoms CLA 2011-10-19 08:18:36 EDT
Right, this is a reasonable use case. Thanks for reporting!
Comment 2 Tatiana Fesenko CLA 2011-10-19 09:43:52 EDT
Thanks for the quick fix, Karsten!

It seams that we also have to change the helper signature in profiling.ext to use uml::Package:

Profile applyProfile (Package pck, String uri)

Otherwise it's not recognized even for uml::Model. E.g., try using the sample transformation from Bug 361382.
Comment 3 Karsten Thoms CLA 2011-10-19 09:53:47 EDT
Yes, this was already done.
Comment 4 Tatiana Fesenko CLA 2011-10-19 09:57:13 EDT
(In reply to comment #3)
> Yes, this was already done.

Maybe it wasn't pushed to Git. In the http://git.eclipse.org/c/m2t/org.eclipse.xpand.git/tree/plugins/org.eclipse.xtend.typesystem.uml2/src/org/eclipse/xtend/typesystem/uml2/profile/profiling.ext?id=20403e9f00e8993ce99b76299ecb52948a9f331a

only line 8 is changes, while the line 7 with helper signature is still the same:

Profile applyProfile (Model model, String uri) :
- JAVA org.eclipse.xtend.typesystem.uml2.profile.ProfilingExtensions.applyProfile(org.eclipse.uml2.uml.Model, java.lang.String);
+ JAVA org.eclipse.xtend.typesystem.uml2.profile.ProfilingExtensions.applyProfile(org.eclipse.uml2.uml.Package, java.lang.String);
Comment 5 Karsten Thoms CLA 2011-10-19 10:20:20 EDT
My mistake. Fixed now with 45fae56604e0e7ced51b1bc9a316d86ccb586b23
Comment 6 Karsten Thoms CLA 2013-02-21 08:14:01 EST
Bug resolved before Xpand 1.2 release date => Closing