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

Bug 313048

Summary: [ast] OCLExpression.name can be incorrectly cached
Product: [Modeling] OCL Reporter: Ed Willink <ed>
Component: CoreAssignee: OCL Inbox <mdt-ocl-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 Flags: ed: indigo-
Version: 3.0.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard: Release Currency, Legacy
Bug Depends on:    
Bug Blocks: 318379    

Description Ed Willink CLA 2010-05-16 17:33:05 EDT
As reported in the EMF newgroup "EAnnotations and their contents" thread, the name of for instance a Collection can be computed prematurely by ill-advised user code, causing a problem when the name is set later in the load process.

As observed by Ed Merks, the cached value does not track its algorithmic source.

----

Specification-wise, OclExpression::name is a mess, caused by the dubious inheritance of OclExpression from TypedElement. What is the name of "1 + 2"? unspecified. The name "Set(XX)" is inadequate because there may be multiple XXs (a known OCL issue) but specigfied as derived. The name in x->forAll( is of course a normal name.

----

MDT/OCL is stuck with the OMG specification, but should at least cache the name in a way that does not violate EMF behaviours.