eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[pivot] Inconsistent null-free default #2212

Open eclipse-ocl-bot opened 3 days ago

eclipse-ocl-bot commented 3 days ago

| --- | --- | | Bugzilla Link | 577427 | | Status | NEW | | Importance | P3 normal | | Reported | Nov 24, 2021 07:08 EDT | | Modified | Dec 13, 2021 15:21 EDT | | Reporter | Ed Willink |

Description

Pivot.ecore has no annotations justifying the null-freeness that exists in OCLMetamodel and Pivot.oclas.

The inconsistent/helpful conversion occurs in Ecore2AS.isNullFree with a comment:

// UML collections are always null-free.Make it the undeclared default.

even though it is not in a proven UML conversion. (Within GenerateOCLPivotModel it is actually UML.)

Null-free default seems appopriate, but it should be conistent...

Ecore2AS.isNullFree has a check for a PivotConstants.COLLECTION_ANNOTATION_SOURCE on an ETypedElement. This should be extended to a corresponding check on the EPackage where an annotation should be found that emanates from the UML2Ecore synthesis.

eclipse-ocl-bot commented 3 days ago

By Ed Willink on Dec 13, 2021 15:21

For the benefit of LoopExp.ownedCoIterators, UML2Ecore now supports a not-nullFree EAnnotation whose definition is in OCL.uml, where a nullFree default is applied to the root Package.

Pivot.ecore now has the root null-free and the co-iteratrs not-free EAnnotations.

Ecore2AS now falls back from EReference to EClass and then to EPackage EAnnotations before applying the nullFree default.