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

Bug 284810

Summary: Problems with EOCL_ENV declaration when switching back and forth between using operations package and not using operations package
Product: [Modeling] MDT.UML2 Reporter: John T.E. Timm <johntimm>
Component: CoreAssignee: Kenn Hussey <Kenn.Hussey>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bruck.james, Kenn.Hussey
Version: unspecifiedKeywords: plan
Target Milestone: RC2Flags: Kenn.Hussey: indigo+
Kenn.Hussey: pmc_approved+
Hardware: PC   
OS: Windows XP   
Whiteboard: Community Support
Attachments:
Description Flags
Patch Kenn.Hussey: iplog+

Description John T.E. Timm CLA 2009-07-27 19:40:47 EDT
Build ID: M20080911-1700

Steps To Reproduce:
1. Create new UML model (Model A).
2. Create a class (Class A) that includes an OCL invariant.
3. Use UML2 EMF model importer to convert UML model to EMF model (make sure to include "Process Operation Bodies" in the model importer wizard).
4. Configure genmodel to use operations package.
5. Generate model code.
6. Create second project/model (Model B).
7. Create a class (Class B) that extends Class A in first model.
8. Create another invariant constraint (with a different name).
9. Use UML2 EMF model importer to create EMF model for Model B.
10. Make sure that Model B is NOT configured to use operatoins package.
11. Generate Model code.
12. Inspect ClassBImpl.java for compile error.

More information:
In this scenario, we are switching between using operations package and not using operations classes. The code that is used to generate the EOCL_ENV assumes that the user will either *always* use operations packages from one model to the next or *never* use operations packages from one model to the next. Therefore, if switching occurs, EOCL_ENV should be declared after each switch. The same problem occurs if we start Model A without operations package and switch to using operations package in Model B.
Comment 1 John T.E. Timm CLA 2009-07-27 19:42:11 EDT
Created attachment 142717 [details]
Patch

This patch changes the condition on the generation of the EOCL_ENV field in OperationsClass.javajet and Class/insert.javajetinc such that EOCL_ENV will be declared if switching occurs.
Comment 2 Kenn Hussey CLA 2011-05-08 23:36:56 EDT
The fix has been committed to CVS.
Comment 3 Kenn Hussey CLA 2011-05-17 23:03:32 EDT
The logic for one of the cases was incorrect (inadvertant '!').
Comment 4 Kenn Hussey CLA 2011-05-17 23:04:22 EDT
The fix has been committed to CVS and will be available in the RC2 build.
Comment 5 Kenn Hussey CLA 2011-05-23 14:21:22 EDT
Fix available in RC2 build.
Comment 6 Kenn Hussey CLA 2011-05-31 10:29:10 EDT
Closing for Indigo release.