Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Juno: code errors in generated model code of static uml profile
Juno: code errors in generated model code of static uml profile [message #892714] Fri, 29 June 2012 10:29 Go to next message
Christian D is currently offline Christian DFriend
Messages: 12
Registered: February 2012
Junior Member
I'm porting a static profile from indigo to juno release.
I have already updated all changed extension points and references inside the uml profile. But when generating the model code from the genmodel, I experience a case error in the PackageImpl class (see below). It is easy to correct by hand and the profile works fine afterwards, but annoying as the error reappears every time the model code is generated again. Did I miss something while porting? Is there any way to fix this?

In the following snipped org.eclipse.uml2.types.typesPackage should actually be org.eclipse.uml2.types.TypesPackage. The line wasn't even there in indigo.

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Obtain other dependent packages
		UMLPackage theUMLPackage = (UMLPackage)EPackage.Registry.INSTANCE.getEPackage(UMLPackage.eNS_URI);
		org.eclipse.uml2.types.typesPackage thetypesPackage = (org.eclipse.uml2.types.typesPackage)EPackage.Registry.INSTANCE.getEPackage(org.eclipse.uml2.types.typesPackage.eNS_URI);
		SystemViewPackage theSystemViewPackage = (SystemViewPackage)EPackage.Registry.INSTANCE.getEPackage(SystemViewPackage.eNS_URI);
...

Re: Juno: code errors in generated model code of static uml profile [message #892844 is a reply to message #892714] Sat, 30 June 2012 11:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Christian,

I think this is a problem with the latest version of the UML2.genmodel,
which treats this types packages as kind of a built-in model for which
it produces a GenPackage wrapper automatically. I suspect it's not
initializing the GenPackage's prefix property properly. Please open a
bugzilla against UML2.


On 29/06/2012 12:29 PM, Christian Drabek wrote:
> I'm porting a static profile from indigo to juno release.
> I have already updated all changed extension points and references
> inside the uml profile. But when generating the model code from the
> genmodel, I experience a case error in the PackageImpl class (see
> below). It is easy to correct by hand and the profile works fine
> afterwards, but annoying as the error reappears every time the model
> code is generated again. Did I miss something while porting? Is there
> any way to fix this?
>
> In the following snipped org.eclipse.uml2.types.typesPackage should
> actually be org.eclipse.uml2.types.TypesPackage. The line wasn't even
> there in indigo.
>
>
> /**
> * Complete the initialization of the package and its meta-model.
> This
> * method is guarded to have no affect on any invocation but its
> first.
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @generated
> */
> public void initializePackageContents() {
> if (isInitialized) return;
> isInitialized = true;
>
> // Initialize package
> setName(eNAME);
> setNsPrefix(eNS_PREFIX);
> setNsURI(eNS_URI);
>
> // Obtain other dependent packages
> UMLPackage theUMLPackage =
> (UMLPackage)EPackage.Registry.INSTANCE.getEPackage(UMLPackage.eNS_URI);
> org.eclipse.uml2.types.typesPackage thetypesPackage =
> (org.eclipse.uml2.types.typesPackage)EPackage.Registry.INSTANCE.getEPackage(org.eclipse.uml2.types.typesPackage.eNS_URI);
> SystemViewPackage theSystemViewPackage =
> (SystemViewPackage)EPackage.Registry.INSTANCE.getEPackage(SystemViewPackage.eNS_URI);
> ..
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Juno: code errors in generated model code of static uml profile [message #892848 is a reply to message #892844] Sat, 30 June 2012 12:41 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Are you specifying Types.genmodel as a used gen package? If so, this
looks like a justification for reopening
https://bugs.eclipse.org/bugs/show_bug.cgi?id=366348.

The intention is that the Types package is a hidden secret, so that
users should not notice a UML2 3.0/4.0 change.

Regards

Ed Willink


On 30/06/2012 12:22, Ed Merks wrote:
> Christian,
>
> I think this is a problem with the latest version of the
> UML2.genmodel, which treats this types packages as kind of a built-in
> model for which it produces a GenPackage wrapper automatically. I
> suspect it's not initializing the GenPackage's prefix property
> properly. Please open a bugzilla against UML2.
>
>
> On 29/06/2012 12:29 PM, Christian Drabek wrote:
>> I'm porting a static profile from indigo to juno release.
>> I have already updated all changed extension points and references
>> inside the uml profile. But when generating the model code from the
>> genmodel, I experience a case error in the PackageImpl class (see
>> below). It is easy to correct by hand and the profile works fine
>> afterwards, but annoying as the error reappears every time the model
>> code is generated again. Did I miss something while porting? Is there
>> any way to fix this?
>>
>> In the following snipped org.eclipse.uml2.types.typesPackage should
>> actually be org.eclipse.uml2.types.TypesPackage. The line wasn't even
>> there in indigo.
>>
>>
>> /**
>> * Complete the initialization of the package and its
>> meta-model. This
>> * method is guarded to have no affect on any invocation but its
>> first.
>> * <!-- begin-user-doc -->
>> * <!-- end-user-doc -->
>> * @generated
>> */
>> public void initializePackageContents() {
>> if (isInitialized) return;
>> isInitialized = true;
>>
>> // Initialize package
>> setName(eNAME);
>> setNsPrefix(eNS_PREFIX);
>> setNsURI(eNS_URI);
>>
>> // Obtain other dependent packages
>> UMLPackage theUMLPackage =
>> (UMLPackage)EPackage.Registry.INSTANCE.getEPackage(UMLPackage.eNS_URI);
>> org.eclipse.uml2.types.typesPackage thetypesPackage =
>> (org.eclipse.uml2.types.typesPackage)EPackage.Registry.INSTANCE.getEPackage(org.eclipse.uml2.types.typesPackage.eNS_URI);
>> SystemViewPackage theSystemViewPackage =
>> (SystemViewPackage)EPackage.Registry.INSTANCE.getEPackage(SystemViewPackage.eNS_URI);
>> ..
>>
>>
>
>
Re: Juno: code errors in generated model code of static uml profile [message #895751 is a reply to message #892848] Sun, 15 July 2012 17:44 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=382637.

Regards

Ed Willink


On 30/06/2012 13:41, Ed Willink wrote:
> Hi
>
> Are you specifying Types.genmodel as a used gen package? If so, this
> looks like a justification for reopening
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=366348.
>
> The intention is that the Types package is a hidden secret, so that
> users should not notice a UML2 3.0/4.0 change.
>
> Regards
>
> Ed Willink
>
>
> On 30/06/2012 12:22, Ed Merks wrote:
>> Christian,
>>
>> I think this is a problem with the latest version of the
>> UML2.genmodel, which treats this types packages as kind of a built-in
>> model for which it produces a GenPackage wrapper automatically. I
>> suspect it's not initializing the GenPackage's prefix property
>> properly. Please open a bugzilla against UML2.
>>
>>
>> On 29/06/2012 12:29 PM, Christian Drabek wrote:
>>> I'm porting a static profile from indigo to juno release.
>>> I have already updated all changed extension points and references
>>> inside the uml profile. But when generating the model code from the
>>> genmodel, I experience a case error in the PackageImpl class (see
>>> below). It is easy to correct by hand and the profile works fine
>>> afterwards, but annoying as the error reappears every time the model
>>> code is generated again. Did I miss something while porting? Is
>>> there any way to fix this?
>>>
>>> In the following snipped org.eclipse.uml2.types.typesPackage should
>>> actually be org.eclipse.uml2.types.TypesPackage. The line wasn't
>>> even there in indigo.
>>>
>>>
>>> /**
>>> * Complete the initialization of the package and its
>>> meta-model. This
>>> * method is guarded to have no affect on any invocation but its
>>> first.
>>> * <!-- begin-user-doc -->
>>> * <!-- end-user-doc -->
>>> * @generated
>>> */
>>> public void initializePackageContents() {
>>> if (isInitialized) return;
>>> isInitialized = true;
>>>
>>> // Initialize package
>>> setName(eNAME);
>>> setNsPrefix(eNS_PREFIX);
>>> setNsURI(eNS_URI);
>>>
>>> // Obtain other dependent packages
>>> UMLPackage theUMLPackage =
>>> (UMLPackage)EPackage.Registry.INSTANCE.getEPackage(UMLPackage.eNS_URI);
>>> org.eclipse.uml2.types.typesPackage thetypesPackage =
>>> (org.eclipse.uml2.types.typesPackage)EPackage.Registry.INSTANCE.getEPackage(org.eclipse.uml2.types.typesPackage.eNS_URI);
>>>
>>> SystemViewPackage theSystemViewPackage =
>>> (SystemViewPackage)EPackage.Registry.INSTANCE.getEPackage(SystemViewPackage.eNS_URI);
>>> ..
>>>
>>>
>>
>>
>
>
Re: Juno: code errors in generated model code of static uml profile [message #920707 is a reply to message #892714] Sun, 23 September 2012 10:48 Go to previous message
Christian Schneider is currently offline Christian SchneiderFriend
Messages: 6
Registered: July 2009
Junior Member
Is there a solution for this problem? Or at least a bugzilla entry for it?

Regards,
Christian
Previous Topic:Wrapped rather than Truncated Text for Use Case Names in Use Case Diagrams
Next Topic:Control / UnControl not visible in the Model Explorer Context Menu
Goto Forum:
  


Current Time: Thu Mar 28 08:19:06 GMT 2024

Powered by FUDForum. Page generated in 0.02716 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top