diff options
author | Ed Willink | 2017-09-26 13:03:44 +0000 |
---|---|---|
committer | Ed Willink | 2017-09-26 13:03:44 +0000 |
commit | 61150be7d71d65114dfa55934848e96d42c391ef (patch) | |
tree | 29204ff507aae7fa1eea72f882622675239aff5b | |
parent | a114d3d7684d76c66a52775b1276377702704834 (diff) | |
download | org.eclipse.ocl-61150be7d71d65114dfa55934848e96d42c391ef.tar.gz org.eclipse.ocl-61150be7d71d65114dfa55934848e96d42c391ef.tar.xz org.eclipse.ocl-61150be7d71d65114dfa55934848e96d42c391ef.zip |
[unrelated] Regenerate "any" and "closure" constraints
9 files changed, 315 insertions, 381 deletions
diff --git a/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/IteratorExp.java b/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/IteratorExp.java index 3e3b10e183..aa2219024c 100644 --- a/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/IteratorExp.java +++ b/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/IteratorExp.java @@ -91,6 +91,13 @@ public interface IteratorExp extends LoopExp, ReferringElement * <!-- end-user-doc --> * @generated */ + boolean validateClosureResultElementTypeIsIteratorType(DiagnosticChain diagnostics, Map<Object, Object> context); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ boolean validateClosureTypeIsUniqueCollection(DiagnosticChain diagnostics, Map<Object, Object> context); /** diff --git a/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/PivotPackage.java b/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/PivotPackage.java index 0f3ba2d7be..0de4504534 100644 --- a/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/PivotPackage.java +++ b/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/PivotPackage.java @@ -12961,13 +12961,22 @@ extends EPackage int ITERATOR_EXP___VALIDATE_CLOSURE_HAS_ONE_ITERATOR__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 7; /** + * The operation id for the '<em>Validate Closure Result Element Type Is Iterator Type</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ITERATOR_EXP___VALIDATE_CLOSURE_RESULT_ELEMENT_TYPE_IS_ITERATOR_TYPE__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 8; + + /** * The operation id for the '<em>Validate Closure Source Element Type Is Body Element Type</em>' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int ITERATOR_EXP___VALIDATE_CLOSURE_SOURCE_ELEMENT_TYPE_IS_BODY_ELEMENT_TYPE__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 8; + int ITERATOR_EXP___VALIDATE_CLOSURE_SOURCE_ELEMENT_TYPE_IS_BODY_ELEMENT_TYPE__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 9; /** * The operation id for the '<em>Validate Closure Type Is Unique Collection</em>' operation. @@ -12976,7 +12985,7 @@ extends EPackage * @generated * @ordered */ - int ITERATOR_EXP___VALIDATE_CLOSURE_TYPE_IS_UNIQUE_COLLECTION__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 9; + int ITERATOR_EXP___VALIDATE_CLOSURE_TYPE_IS_UNIQUE_COLLECTION__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 10; /** * The operation id for the '<em>Validate Collect Element Type Is Flattened Body Type</em>' operation. @@ -12985,7 +12994,7 @@ extends EPackage * @generated * @ordered */ - int ITERATOR_EXP___VALIDATE_COLLECT_ELEMENT_TYPE_IS_FLATTENED_BODY_TYPE__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 10; + int ITERATOR_EXP___VALIDATE_COLLECT_ELEMENT_TYPE_IS_FLATTENED_BODY_TYPE__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 11; /** * The operation id for the '<em>Validate Collect Type Is Unordered</em>' operation. @@ -12994,7 +13003,7 @@ extends EPackage * @generated * @ordered */ - int ITERATOR_EXP___VALIDATE_COLLECT_TYPE_IS_UNORDERED__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 11; + int ITERATOR_EXP___VALIDATE_COLLECT_TYPE_IS_UNORDERED__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 12; /** * The operation id for the '<em>Validate Iterator Type Is Source Element Type</em>' operation. @@ -13003,7 +13012,7 @@ extends EPackage * @generated * @ordered */ - int ITERATOR_EXP___VALIDATE_ITERATOR_TYPE_IS_SOURCE_ELEMENT_TYPE__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 12; + int ITERATOR_EXP___VALIDATE_ITERATOR_TYPE_IS_SOURCE_ELEMENT_TYPE__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 13; /** * The operation id for the '<em>Validate Safe Iterator Is Required</em>' operation. @@ -13012,7 +13021,7 @@ extends EPackage * @generated * @ordered */ - int ITERATOR_EXP___VALIDATE_SAFE_ITERATOR_IS_REQUIRED__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 13; + int ITERATOR_EXP___VALIDATE_SAFE_ITERATOR_IS_REQUIRED__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 14; /** * The operation id for the '<em>Validate Safe Source Can Be Null</em>' operation. @@ -13021,7 +13030,7 @@ extends EPackage * @generated * @ordered */ - int ITERATOR_EXP___VALIDATE_SAFE_SOURCE_CAN_BE_NULL__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 14; + int ITERATOR_EXP___VALIDATE_SAFE_SOURCE_CAN_BE_NULL__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 15; /** * The operation id for the '<em>Validate Sorted By Element Type Is Source Element Type</em>' operation. @@ -13030,7 +13039,7 @@ extends EPackage * @generated * @ordered */ - int ITERATOR_EXP___VALIDATE_SORTED_BY_ELEMENT_TYPE_IS_SOURCE_ELEMENT_TYPE__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 15; + int ITERATOR_EXP___VALIDATE_SORTED_BY_ELEMENT_TYPE_IS_SOURCE_ELEMENT_TYPE__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 16; /** * The operation id for the '<em>Validate Sorted By Is Ordered If Source Is Ordered</em>' operation. @@ -13039,7 +13048,7 @@ extends EPackage * @generated * @ordered */ - int ITERATOR_EXP___VALIDATE_SORTED_BY_IS_ORDERED_IF_SOURCE_IS_ORDERED__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 16; + int ITERATOR_EXP___VALIDATE_SORTED_BY_IS_ORDERED_IF_SOURCE_IS_ORDERED__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 17; /** * The operation id for the '<em>Validate Sorted By Iterator Type Is Comparable</em>' operation. @@ -13048,7 +13057,7 @@ extends EPackage * @generated * @ordered */ - int ITERATOR_EXP___VALIDATE_SORTED_BY_ITERATOR_TYPE_IS_COMPARABLE__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 17; + int ITERATOR_EXP___VALIDATE_SORTED_BY_ITERATOR_TYPE_IS_COMPARABLE__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 18; /** * The operation id for the '<em>Validate Unsafe Source Can Not Be Null</em>' operation. @@ -13057,7 +13066,7 @@ extends EPackage * @generated * @ordered */ - int ITERATOR_EXP___VALIDATE_UNSAFE_SOURCE_CAN_NOT_BE_NULL__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 18; + int ITERATOR_EXP___VALIDATE_UNSAFE_SOURCE_CAN_NOT_BE_NULL__DIAGNOSTICCHAIN_MAP = LOOP_EXP_OPERATION_COUNT + 19; /** * The number of operations of the '<em>Iterator Exp</em>' class. @@ -13066,7 +13075,7 @@ extends EPackage * @generated * @ordered */ - int ITERATOR_EXP_OPERATION_COUNT = LOOP_EXP_OPERATION_COUNT + 19; + int ITERATOR_EXP_OPERATION_COUNT = LOOP_EXP_OPERATION_COUNT + 20; /** * The meta object id for the '{@link org.eclipse.ocl.pivot.internal.LetVariableImpl <em>Let Variable</em>}' class. @@ -26736,6 +26745,16 @@ extends EPackage EOperation getIteratorExp__ValidateClosureHasOneIterator__DiagnosticChain_Map(); /** + * Returns the meta object for the '{@link org.eclipse.ocl.pivot.IteratorExp#validateClosureResultElementTypeIsIteratorType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Closure Result Element Type Is Iterator Type</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Validate Closure Result Element Type Is Iterator Type</em>' operation. + * @see org.eclipse.ocl.pivot.IteratorExp#validateClosureResultElementTypeIsIteratorType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * @generated + */ + EOperation getIteratorExp__ValidateClosureResultElementTypeIsIteratorType__DiagnosticChain_Map(); + + /** * Returns the meta object for the '{@link org.eclipse.ocl.pivot.IteratorExp#validateClosureTypeIsUniqueCollection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Closure Type Is Unique Collection</em>}' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -32024,6 +32043,14 @@ extends EPackage EOperation ITERATOR_EXP___VALIDATE_CLOSURE_HAS_ONE_ITERATOR__DIAGNOSTICCHAIN_MAP = eINSTANCE.getIteratorExp__ValidateClosureHasOneIterator__DiagnosticChain_Map(); /** + * The meta object literal for the '<em><b>Validate Closure Result Element Type Is Iterator Type</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation ITERATOR_EXP___VALIDATE_CLOSURE_RESULT_ELEMENT_TYPE_IS_ITERATOR_TYPE__DIAGNOSTICCHAIN_MAP = eINSTANCE.getIteratorExp__ValidateClosureResultElementTypeIsIteratorType__DiagnosticChain_Map(); + + /** * The meta object literal for the '<em><b>Validate Closure Type Is Unique Collection</b></em>' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/PivotTables.java b/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/PivotTables.java index c828b5dd0a..a03739b4ae 100644 --- a/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/PivotTables.java +++ b/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/PivotTables.java @@ -188,7 +188,6 @@ public class PivotTables public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull TuplePartId PARTid__0 = org.eclipse.ocl.pivot.ids.IdManager.getTuplePartId(0, "message", org.eclipse.ocl.pivot.ids.TypeId.STRING); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull CollectionTypeId SEQ_PRIMid_Integer = org.eclipse.ocl.pivot.ids.TypeId.SEQUENCE.getSpecializedId(org.eclipse.ocl.pivot.ids.TypeId.INTEGER); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull CollectionTypeId SET_PRIMid_String = org.eclipse.ocl.pivot.ids.TypeId.SET.getSpecializedId(org.eclipse.ocl.pivot.ids.TypeId.STRING); - public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Boolean = "Boolean"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_BooleanLiteralExp_c_c_TypeIsBoolean = "BooleanLiteralExp::TypeIsBoolean"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_CallExp_c_c_TypeIsNotInvalid = "CallExp::TypeIsNotInvalid"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Class_c_c_NameIsNotNull = "Class::NameIsNotNull"; @@ -217,9 +216,8 @@ public class PivotTables public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_IteratorExp_c_c_AnyHasOneIterator = "IteratorExp::AnyHasOneIterator"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_IteratorExp_c_c_AnyTypeIsSourceElementType = "IteratorExp::AnyTypeIsSourceElementType"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_IteratorExp_c_c_ClosureBodyElementTypeIsIteratorType = "IteratorExp::ClosureBodyElementTypeIsIteratorType"; - public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_IteratorExp_c_c_ClosureElementTypeIsSourceElementType = "IteratorExp::ClosureElementTypeIsSourceElementType"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_IteratorExp_c_c_ClosureHasOneIterator = "IteratorExp::ClosureHasOneIterator"; - public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_IteratorExp_c_c_ClosureSourceElementTypeIsBodyElementType = "IteratorExp::ClosureSourceElementTypeIsBodyElementType"; + public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_IteratorExp_c_c_ClosureResultElementTypeIsIteratorType = "IteratorExp::ClosureResultElementTypeIsIteratorType"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_IteratorExp_c_c_ClosureTypeIsUniqueCollection = "IteratorExp::ClosureTypeIsUniqueCollection"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_IteratorExp_c_c_CollectElementTypeIsFlattenedBodyType = "IteratorExp::CollectElementTypeIsFlattenedBodyType"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_IteratorExp_c_c_CollectTypeIsUnordered = "IteratorExp::CollectTypeIsUnordered"; diff --git a/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/internal/IteratorExpImpl.java b/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/internal/IteratorExpImpl.java index 1a6a677ff1..1080ae3803 100644 --- a/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/internal/IteratorExpImpl.java +++ b/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/internal/IteratorExpImpl.java @@ -472,7 +472,12 @@ public class IteratorExpImpl extends LoopExpImpl implements IteratorExp * else * let result : Boolean[?] = name = 'closure' implies * let - * bodyElementType : Type[1] = ownedBody.type.oclAsType(CollectionType).elementType + * bodyElementType : Type[?] = if + * ownedBody.type.oclIsKindOf(CollectionType) + * then + * ownedBody.type.oclAsType(CollectionType).elementType + * else ownedBody.type + * endif * in * let iteratorType : Type[?] = ownedIterators->at(1).type * in bodyElementType.conformsTo(iteratorType) @@ -497,11 +502,19 @@ public class IteratorExpImpl extends LoopExpImpl implements IteratorExp if (eq) { final /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull Class TYP_CollectionType_0 = idResolver.getClass(PivotTables.CLSSid_CollectionType, null); @SuppressWarnings("null") - final /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull OCLExpression ownedBody = this.getOwnedBody(); - final /*@NonInvalid*/ org.eclipse.ocl.pivot.@Nullable Type type = ownedBody.getType(); - final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull CollectionType oclAsType = ClassUtil.nonNullState((CollectionType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, type, TYP_CollectionType_0)); - @SuppressWarnings("null") - final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull Type bodyElementType = oclAsType.getElementType(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull OCLExpression ownedBody_1 = this.getOwnedBody(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.@Nullable Type type_1 = ownedBody_1.getType(); + final /*@Thrown*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, type_1, TYP_CollectionType_0).booleanValue(); + /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type bodyElementType; + if (oclIsKindOf) { + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull CollectionType oclAsType = ClassUtil.nonNullState((CollectionType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, type_1, TYP_CollectionType_0)); + @SuppressWarnings("null") + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull Type elementType = oclAsType.getElementType(); + bodyElementType = elementType; + } + else { + bodyElementType = type_1; + } final /*@NonInvalid*/ java.util.@NonNull List<Variable> ownedIterators = this.getOwnedIterators(); final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull OrderedSetValue BOXED_ownedIterators = idResolver.createOrderedSetOfAll(PivotTables.ORD_CLSSid_Variable, ownedIterators); final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Variable at = (Variable)OrderedCollectionAtOperation.INSTANCE.evaluate(BOXED_ownedIterators, PivotTables.INT_1); @@ -543,12 +556,13 @@ public class IteratorExpImpl extends LoopExpImpl implements IteratorExp * if severity <= 0 * then true * else - * let result : Boolean[?] = name = 'any' implies ownedBody.type = 'Boolean' + * let result : Boolean[?] = name = 'any' implies ownedBody.type = Boolean * in * 'IteratorExp::AnyBodyTypeIsBoolean'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0) * endif */ final /*@NonInvalid*/ org.eclipse.ocl.pivot.evaluation.@NonNull Executor executor = PivotUtilInternal.getExecutor(this); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@NonNull IdResolver idResolver = executor.getIdResolver(); final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, PivotTables.STR_IteratorExp_c_c_AnyBodyTypeIsBoolean); final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, PivotTables.INT_0).booleanValue(); /*@NonInvalid*/ boolean symbol_0; @@ -560,10 +574,11 @@ public class IteratorExpImpl extends LoopExpImpl implements IteratorExp final /*@NonInvalid*/ boolean eq = PivotTables.STR_any.equals(name); /*@NonInvalid*/ boolean result; if (eq) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull Class TYP_Boolean_0 = idResolver.getClass(TypeId.BOOLEAN, null); @SuppressWarnings("null") final /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull OCLExpression ownedBody = this.getOwnedBody(); final /*@NonInvalid*/ org.eclipse.ocl.pivot.@Nullable Type type = ownedBody.getType(); - final /*@NonInvalid*/ boolean eq_0 = PivotTables.STR_Boolean.equals(type); + final /*@NonInvalid*/ boolean eq_0 = (type != null) ? (type.getTypeId() == TYP_Boolean_0.getTypeId()) : false; result = eq_0; } else { @@ -632,6 +647,77 @@ public class IteratorExpImpl extends LoopExpImpl implements IteratorExp * @generated */ @Override + public boolean validateClosureResultElementTypeIsIteratorType(final DiagnosticChain diagnostics, final Map<Object, Object> context) + { + /** + * + * inv ClosureResultElementTypeIsIteratorType: + * let + * severity : Integer[1] = 'IteratorExp::ClosureResultElementTypeIsIteratorType'.getSeverity() + * in + * if severity <= 0 + * then true + * else + * let result : Boolean[?] = name = 'closure' implies + * let + * resultElementType : Type[1] = type.oclAsType(CollectionType).elementType + * in + * let iteratorType : Type[?] = ownedIterators->at(1).type + * in iteratorType.conformsTo(resultElementType) + * in + * 'IteratorExp::ClosureResultElementTypeIsIteratorType'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0) + * endif + */ + final /*@NonInvalid*/ org.eclipse.ocl.pivot.evaluation.@NonNull Executor executor = PivotUtilInternal.getExecutor(this); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@NonNull IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, PivotTables.STR_IteratorExp_c_c_ClosureResultElementTypeIsIteratorType); + final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, PivotTables.INT_0).booleanValue(); + /*@NonInvalid*/ boolean symbol_0; + if (le) { + symbol_0 = ValueUtil.TRUE_VALUE; + } + else { + /*@Caught*/ @NonNull Object CAUGHT_result; + try { + final /*@NonInvalid*/ java.lang.@Nullable String name = this.getName(); + final /*@NonInvalid*/ boolean eq = PivotTables.STR_closure.equals(name); + /*@Thrown*/ boolean result; + if (eq) { + final /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull Class TYP_CollectionType_0 = idResolver.getClass(PivotTables.CLSSid_CollectionType, null); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.@Nullable Type type = this.getType(); + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull CollectionType oclAsType = ClassUtil.nonNullState((CollectionType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, type, TYP_CollectionType_0)); + @SuppressWarnings("null") + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull Type resultElementType = oclAsType.getElementType(); + final /*@NonInvalid*/ java.util.@NonNull List<Variable> ownedIterators = this.getOwnedIterators(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull OrderedSetValue BOXED_ownedIterators = idResolver.createOrderedSetOfAll(PivotTables.ORD_CLSSid_Variable, ownedIterators); + final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Variable at = (Variable)OrderedCollectionAtOperation.INSTANCE.evaluate(BOXED_ownedIterators, PivotTables.INT_1); + if (at == null) { + throw new InvalidValueException("Null source for \'TypedElement::type\'"); + } + final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type iteratorType = at.getType(); + final /*@Thrown*/ boolean conformsTo = OclTypeConformsToOperation.INSTANCE.evaluate(executor, iteratorType, resultElementType).booleanValue(); + result = conformsTo; + } + else { + result = ValueUtil.TRUE_VALUE; + } + CAUGHT_result = result; + } + catch (Exception e) { + CAUGHT_result = ValueUtil.createInvalidValue(e); + } + final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, PivotTables.STR_IteratorExp_c_c_ClosureResultElementTypeIsIteratorType, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_result, PivotTables.INT_0).booleanValue(); + symbol_0 = logDiagnostic; + } + return Boolean.TRUE == symbol_0; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public boolean validateClosureTypeIsUniqueCollection(final DiagnosticChain diagnostics, final Map<Object, Object> context) { /** @@ -834,84 +920,9 @@ public class IteratorExpImpl extends LoopExpImpl implements IteratorExp public boolean validateClosureSourceElementTypeIsBodyElementType(final DiagnosticChain diagnostics, final Map<Object, Object> context) { /** - * - * inv ClosureSourceElementTypeIsBodyElementType: - * let - * severity : Integer[1] = 'IteratorExp::ClosureSourceElementTypeIsBodyElementType'.getSeverity() - * in - * if severity <= 0 - * then true - * else - * let result : Boolean[?] = name = 'closure' implies - * ownedSource?.type.oclAsType(CollectionType).elementType = - * if ownedBody.type.oclIsKindOf(CollectionType) - * then - * ownedBody.type.oclAsType(CollectionType).elementType - * else ownedBody.type - * endif - * in - * 'IteratorExp::ClosureSourceElementTypeIsBodyElementType'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0) - * endif + * inv ClosureSourceElementTypeIsBodyElementType: true */ - final /*@NonInvalid*/ org.eclipse.ocl.pivot.evaluation.@NonNull Executor executor = PivotUtilInternal.getExecutor(this); - final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@NonNull IdResolver idResolver = executor.getIdResolver(); - final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, PivotTables.STR_IteratorExp_c_c_ClosureSourceElementTypeIsBodyElementType); - final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, PivotTables.INT_0).booleanValue(); - /*@NonInvalid*/ boolean symbol_2; - if (le) { - symbol_2 = ValueUtil.TRUE_VALUE; - } - else { - /*@Caught*/ @NonNull Object CAUGHT_result; - try { - final /*@NonInvalid*/ java.lang.@Nullable String name = this.getName(); - final /*@NonInvalid*/ boolean eq = PivotTables.STR_closure.equals(name); - /*@Thrown*/ boolean result; - if (eq) { - final /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull Class TYP_CollectionType_1 = idResolver.getClass(PivotTables.CLSSid_CollectionType, null); - @SuppressWarnings("null") - final /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull OCLExpression ownedBody_1 = this.getOwnedBody(); - final /*@NonInvalid*/ org.eclipse.ocl.pivot.@Nullable Type type_2 = ownedBody_1.getType(); - final /*@NonInvalid*/ org.eclipse.ocl.pivot.@Nullable OCLExpression ownedSource = this.getOwnedSource(); - final /*@NonInvalid*/ @NonNull Object symbol_0 = ownedSource == null; - /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type safe_type_source; - if (symbol_0 == Boolean.TRUE) { - safe_type_source = null; - } - else { - assert ownedSource != null; - final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type type = ownedSource.getType(); - safe_type_source = type; - } - final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull CollectionType oclAsType = ClassUtil.nonNullState((CollectionType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, safe_type_source, TYP_CollectionType_1)); - @SuppressWarnings("null") - final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull Type elementType = oclAsType.getElementType(); - final /*@Thrown*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(executor, type_2, TYP_CollectionType_1).booleanValue(); - /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type symbol_1; - if (oclIsKindOf) { - final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull CollectionType oclAsType_0 = ClassUtil.nonNullState((CollectionType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, type_2, TYP_CollectionType_1)); - @SuppressWarnings("null") - final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull Type elementType_0 = oclAsType_0.getElementType(); - symbol_1 = elementType_0; - } - else { - symbol_1 = type_2; - } - final /*@Thrown*/ boolean eq_0 = (symbol_1 != null) ? (elementType.getTypeId() == symbol_1.getTypeId()) : false; - result = eq_0; - } - else { - result = ValueUtil.TRUE_VALUE; - } - CAUGHT_result = result; - } - catch (Exception e) { - CAUGHT_result = ValueUtil.createInvalidValue(e); - } - final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, PivotTables.STR_IteratorExp_c_c_ClosureSourceElementTypeIsBodyElementType, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_result, PivotTables.INT_0).booleanValue(); - symbol_2 = logDiagnostic; - } - return Boolean.TRUE == symbol_2; + return ValueUtil.TRUE_VALUE; } /** @@ -923,70 +934,9 @@ public class IteratorExpImpl extends LoopExpImpl implements IteratorExp public boolean validateClosureElementTypeIsSourceElementType(final DiagnosticChain diagnostics, final Map<Object, Object> context) { /** - * - * inv ClosureElementTypeIsSourceElementType: - * let - * severity : Integer[1] = 'IteratorExp::ClosureElementTypeIsSourceElementType'.getSeverity() - * in - * if severity <= 0 - * then true - * else - * let result : Boolean[?] = name = 'closure' implies - * type.oclAsType(CollectionType).elementType = - * ownedSource?.type.oclAsType(CollectionType).elementType - * in - * 'IteratorExp::ClosureElementTypeIsSourceElementType'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0) - * endif + * inv ClosureElementTypeIsSourceElementType: true */ - final /*@NonInvalid*/ org.eclipse.ocl.pivot.evaluation.@NonNull Executor executor = PivotUtilInternal.getExecutor(this); - final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@NonNull IdResolver idResolver = executor.getIdResolver(); - final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, PivotTables.STR_IteratorExp_c_c_ClosureElementTypeIsSourceElementType); - final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, PivotTables.INT_0).booleanValue(); - /*@NonInvalid*/ boolean symbol_1; - if (le) { - symbol_1 = ValueUtil.TRUE_VALUE; - } - else { - /*@Caught*/ @NonNull Object CAUGHT_result; - try { - final /*@NonInvalid*/ java.lang.@Nullable String name = this.getName(); - final /*@NonInvalid*/ boolean eq = PivotTables.STR_closure.equals(name); - /*@Thrown*/ boolean result; - if (eq) { - final /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull Class TYP_CollectionType_1 = idResolver.getClass(PivotTables.CLSSid_CollectionType, null); - final /*@NonInvalid*/ org.eclipse.ocl.pivot.@Nullable Type type = this.getType(); - final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull CollectionType oclAsType = ClassUtil.nonNullState((CollectionType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, type, TYP_CollectionType_1)); - @SuppressWarnings("null") - final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull Type elementType = oclAsType.getElementType(); - final /*@NonInvalid*/ org.eclipse.ocl.pivot.@Nullable OCLExpression ownedSource = this.getOwnedSource(); - final /*@NonInvalid*/ @NonNull Object symbol_0 = ownedSource == null; - /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type safe_type_source; - if (symbol_0 == Boolean.TRUE) { - safe_type_source = null; - } - else { - assert ownedSource != null; - final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type type_0 = ownedSource.getType(); - safe_type_source = type_0; - } - final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull CollectionType oclAsType_0 = ClassUtil.nonNullState((CollectionType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, safe_type_source, TYP_CollectionType_1)); - @SuppressWarnings("null") - final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull Type elementType_0 = oclAsType_0.getElementType(); - final /*@Thrown*/ boolean eq_0 = elementType.getTypeId() == elementType_0.getTypeId(); - result = eq_0; - } - else { - result = ValueUtil.TRUE_VALUE; - } - CAUGHT_result = result; - } - catch (Exception e) { - CAUGHT_result = ValueUtil.createInvalidValue(e); - } - final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, PivotTables.STR_IteratorExp_c_c_ClosureElementTypeIsSourceElementType, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_result, PivotTables.INT_0).booleanValue(); - symbol_1 = logDiagnostic; - } - return Boolean.TRUE == symbol_1; + return ValueUtil.TRUE_VALUE; } /** @@ -1238,7 +1188,7 @@ public class IteratorExpImpl extends LoopExpImpl implements IteratorExp * else * let result : Boolean[?] = name = 'sortedBy' implies * type.oclAsType(CollectionType).elementType = - * ownedBody.type.oclAsType(CollectionType).elementType + * ownedSource?.type.oclAsType(CollectionType).elementType * in * 'IteratorExp::SortedByElementTypeIsSourceElementType'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0) * endif @@ -1247,9 +1197,9 @@ public class IteratorExpImpl extends LoopExpImpl implements IteratorExp final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@NonNull IdResolver idResolver = executor.getIdResolver(); final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, PivotTables.STR_IteratorExp_c_c_SortedByElementTypeIsSourceElementType); final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, PivotTables.INT_0).booleanValue(); - /*@NonInvalid*/ boolean symbol_0; + /*@NonInvalid*/ boolean symbol_1; if (le) { - symbol_0 = ValueUtil.TRUE_VALUE; + symbol_1 = ValueUtil.TRUE_VALUE; } else { /*@Caught*/ @NonNull Object CAUGHT_result; @@ -1263,10 +1213,18 @@ public class IteratorExpImpl extends LoopExpImpl implements IteratorExp final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull CollectionType oclAsType = ClassUtil.nonNullState((CollectionType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, type, TYP_CollectionType_1)); @SuppressWarnings("null") final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull Type elementType = oclAsType.getElementType(); - @SuppressWarnings("null") - final /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull OCLExpression ownedBody = this.getOwnedBody(); - final /*@NonInvalid*/ org.eclipse.ocl.pivot.@Nullable Type type_0 = ownedBody.getType(); - final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull CollectionType oclAsType_0 = ClassUtil.nonNullState((CollectionType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, type_0, TYP_CollectionType_1)); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.@Nullable OCLExpression ownedSource = this.getOwnedSource(); + final /*@NonInvalid*/ @NonNull Object symbol_0 = ownedSource == null; + /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type safe_type_source; + if (symbol_0 == Boolean.TRUE) { + safe_type_source = null; + } + else { + assert ownedSource != null; + final /*@Thrown*/ org.eclipse.ocl.pivot.@Nullable Type type_0 = ownedSource.getType(); + safe_type_source = type_0; + } + final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull CollectionType oclAsType_0 = ClassUtil.nonNullState((CollectionType)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, safe_type_source, TYP_CollectionType_1)); @SuppressWarnings("null") final /*@Thrown*/ org.eclipse.ocl.pivot.@NonNull Type elementType_0 = oclAsType_0.getElementType(); final /*@Thrown*/ boolean eq_0 = elementType.getTypeId() == elementType_0.getTypeId(); @@ -1281,9 +1239,9 @@ public class IteratorExpImpl extends LoopExpImpl implements IteratorExp CAUGHT_result = ValueUtil.createInvalidValue(e); } final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, PivotTables.STR_IteratorExp_c_c_SortedByElementTypeIsSourceElementType, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_result, PivotTables.INT_0).booleanValue(); - symbol_0 = logDiagnostic; + symbol_1 = logDiagnostic; } - return Boolean.TRUE == symbol_0; + return Boolean.TRUE == symbol_1; } /** @@ -1585,6 +1543,8 @@ public class IteratorExpImpl extends LoopExpImpl implements IteratorExp return validateClosureElementTypeIsSourceElementType((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); case PivotPackage.ITERATOR_EXP___VALIDATE_CLOSURE_HAS_ONE_ITERATOR__DIAGNOSTICCHAIN_MAP: return validateClosureHasOneIterator((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); + case PivotPackage.ITERATOR_EXP___VALIDATE_CLOSURE_RESULT_ELEMENT_TYPE_IS_ITERATOR_TYPE__DIAGNOSTICCHAIN_MAP: + return validateClosureResultElementTypeIsIteratorType((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); case PivotPackage.ITERATOR_EXP___VALIDATE_CLOSURE_SOURCE_ELEMENT_TYPE_IS_BODY_ELEMENT_TYPE__DIAGNOSTICCHAIN_MAP: return validateClosureSourceElementTypeIsBodyElementType((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); case PivotPackage.ITERATOR_EXP___VALIDATE_CLOSURE_TYPE_IS_UNIQUE_COLLECTION__DIAGNOSTICCHAIN_MAP: diff --git a/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/internal/PivotPackageImpl.java b/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/internal/PivotPackageImpl.java index cb5a2b56ba..22a08eb1db 100644 --- a/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/internal/PivotPackageImpl.java +++ b/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/internal/PivotPackageImpl.java @@ -1221,7 +1221,6 @@ implements PivotPackage { // Mark meta-data to indicate it can't be changed thePivotPackage.freeze(); - // Update the registry and return the package EPackage.Registry.INSTANCE.put(PivotPackage.eNS_URI, thePivotPackage); return thePivotPackage; @@ -2495,7 +2494,7 @@ implements PivotPackage { @Override public EOperation getIteratorExp__ValidateSortedByIteratorTypeIsComparable__DiagnosticChain_Map() { - return iteratorExpEClass.getEOperations().get(16); + return iteratorExpEClass.getEOperations().get(17); } /** @@ -2506,7 +2505,7 @@ implements PivotPackage { @Override public EOperation getIteratorExp__ValidateUnsafeSourceCanNotBeNull__DiagnosticChain_Map() { - return iteratorExpEClass.getEOperations().get(17); + return iteratorExpEClass.getEOperations().get(18); } /** @@ -2593,9 +2592,20 @@ implements PivotPackage { * @generated */ @Override + public EOperation getIteratorExp__ValidateClosureResultElementTypeIsIteratorType__DiagnosticChain_Map() + { + return iteratorExpEClass.getEOperations().get(7); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public EOperation getIteratorExp__ValidateClosureTypeIsUniqueCollection__DiagnosticChain_Map() { - return iteratorExpEClass.getEOperations().get(8); + return iteratorExpEClass.getEOperations().get(9); } /** @@ -2606,7 +2616,7 @@ implements PivotPackage { @Override public EOperation getIteratorExp__ValidateCollectElementTypeIsFlattenedBodyType__DiagnosticChain_Map() { - return iteratorExpEClass.getEOperations().get(9); + return iteratorExpEClass.getEOperations().get(10); } /** @@ -2617,7 +2627,7 @@ implements PivotPackage { @Override public EOperation getIteratorExp__ValidateClosureSourceElementTypeIsBodyElementType__DiagnosticChain_Map() { - return iteratorExpEClass.getEOperations().get(7); + return iteratorExpEClass.getEOperations().get(8); } /** @@ -2639,7 +2649,7 @@ implements PivotPackage { @Override public EOperation getIteratorExp__ValidateCollectTypeIsUnordered__DiagnosticChain_Map() { - return iteratorExpEClass.getEOperations().get(10); + return iteratorExpEClass.getEOperations().get(11); } /** @@ -2650,7 +2660,7 @@ implements PivotPackage { @Override public EOperation getIteratorExp__ValidateSortedByIsOrderedIfSourceIsOrdered__DiagnosticChain_Map() { - return iteratorExpEClass.getEOperations().get(15); + return iteratorExpEClass.getEOperations().get(16); } /** @@ -2661,7 +2671,7 @@ implements PivotPackage { @Override public EOperation getIteratorExp__ValidateSortedByElementTypeIsSourceElementType__DiagnosticChain_Map() { - return iteratorExpEClass.getEOperations().get(14); + return iteratorExpEClass.getEOperations().get(15); } /** @@ -2672,7 +2682,7 @@ implements PivotPackage { @Override public EOperation getIteratorExp__ValidateIteratorTypeIsSourceElementType__DiagnosticChain_Map() { - return iteratorExpEClass.getEOperations().get(11); + return iteratorExpEClass.getEOperations().get(12); } /** @@ -2683,7 +2693,7 @@ implements PivotPackage { @Override public EOperation getIteratorExp__ValidateSafeIteratorIsRequired__DiagnosticChain_Map() { - return iteratorExpEClass.getEOperations().get(12); + return iteratorExpEClass.getEOperations().get(13); } /** @@ -2694,7 +2704,7 @@ implements PivotPackage { @Override public EOperation getIteratorExp__ValidateSafeSourceCanBeNull__DiagnosticChain_Map() { - return iteratorExpEClass.getEOperations().get(13); + return iteratorExpEClass.getEOperations().get(14); } /** @@ -7104,6 +7114,7 @@ implements PivotPackage { createEOperation(iteratorExpEClass, ITERATOR_EXP___VALIDATE_CLOSURE_BODY_TYPE_IS_CONFORMANTTO_ITERATOR_TYPE__DIAGNOSTICCHAIN_MAP); createEOperation(iteratorExpEClass, ITERATOR_EXP___VALIDATE_CLOSURE_ELEMENT_TYPE_IS_SOURCE_ELEMENT_TYPE__DIAGNOSTICCHAIN_MAP); createEOperation(iteratorExpEClass, ITERATOR_EXP___VALIDATE_CLOSURE_HAS_ONE_ITERATOR__DIAGNOSTICCHAIN_MAP); + createEOperation(iteratorExpEClass, ITERATOR_EXP___VALIDATE_CLOSURE_RESULT_ELEMENT_TYPE_IS_ITERATOR_TYPE__DIAGNOSTICCHAIN_MAP); createEOperation(iteratorExpEClass, ITERATOR_EXP___VALIDATE_CLOSURE_SOURCE_ELEMENT_TYPE_IS_BODY_ELEMENT_TYPE__DIAGNOSTICCHAIN_MAP); createEOperation(iteratorExpEClass, ITERATOR_EXP___VALIDATE_CLOSURE_TYPE_IS_UNIQUE_COLLECTION__DIAGNOSTICCHAIN_MAP); createEOperation(iteratorExpEClass, ITERATOR_EXP___VALIDATE_COLLECT_ELEMENT_TYPE_IS_FLATTENED_BODY_TYPE__DIAGNOSTICCHAIN_MAP); @@ -8193,6 +8204,15 @@ implements PivotPackage { g1.getETypeArguments().add(g2); addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + op = initEOperation(getIteratorExp__ValidateClosureResultElementTypeIsIteratorType__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateClosureResultElementTypeIsIteratorType", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + g1 = createEGenericType(ecorePackage.getEMap()); + g2 = createEGenericType(ecorePackage.getEJavaObject()); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(ecorePackage.getEJavaObject()); + g1.getETypeArguments().add(g2); + addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + op = initEOperation(getIteratorExp__ValidateClosureSourceElementTypeIsBodyElementType__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateClosureSourceElementTypeIsBodyElementType", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ g1 = createEGenericType(ecorePackage.getEMap()); @@ -9391,6 +9411,13 @@ implements PivotPackage { "originalName", "ClosureHasOneIterator" //$NON-NLS-1$ //$NON-NLS-2$ }); addAnnotation + (getIteratorExp__ValidateClosureResultElementTypeIsIteratorType__DiagnosticChain_Map(), + source, + new String[] + { + "originalName", "ClosureResultElementTypeIsIteratorType" //$NON-NLS-1$ //$NON-NLS-2$ + }); + addAnnotation (getIteratorExp__ValidateClosureSourceElementTypeIsBodyElementType__DiagnosticChain_Map(), source, new String[] diff --git a/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/util/PivotValidator.java b/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/util/PivotValidator.java index c348aee40d..f3baa789c4 100644 --- a/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/util/PivotValidator.java +++ b/plugins/org.eclipse.ocl.pivot/emf-gen/org/eclipse/ocl/pivot/util/PivotValidator.java @@ -17,134 +17,7 @@ import org.eclipse.emf.common.util.ResourceLocator; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.util.EObjectValidator; -import org.eclipse.ocl.pivot.Annotation; -import org.eclipse.ocl.pivot.AnyType; -import org.eclipse.ocl.pivot.AssociationClass; -import org.eclipse.ocl.pivot.AssociationClassCallExp; -import org.eclipse.ocl.pivot.AssociativityKind; -import org.eclipse.ocl.pivot.BagType; -import org.eclipse.ocl.pivot.Behavior; -import org.eclipse.ocl.pivot.BooleanLiteralExp; -import org.eclipse.ocl.pivot.CallExp; -import org.eclipse.ocl.pivot.CallOperationAction; -import org.eclipse.ocl.pivot.CollectionItem; -import org.eclipse.ocl.pivot.CollectionKind; -import org.eclipse.ocl.pivot.CollectionLiteralExp; -import org.eclipse.ocl.pivot.CollectionLiteralPart; -import org.eclipse.ocl.pivot.CollectionRange; -import org.eclipse.ocl.pivot.CollectionType; -import org.eclipse.ocl.pivot.Comment; -import org.eclipse.ocl.pivot.CompleteClass; -import org.eclipse.ocl.pivot.CompleteEnvironment; -import org.eclipse.ocl.pivot.CompleteModel; -import org.eclipse.ocl.pivot.CompletePackage; -import org.eclipse.ocl.pivot.ConnectionPointReference; -import org.eclipse.ocl.pivot.Constraint; -import org.eclipse.ocl.pivot.DataType; -import org.eclipse.ocl.pivot.Detail; -import org.eclipse.ocl.pivot.DynamicBehavior; -import org.eclipse.ocl.pivot.DynamicElement; -import org.eclipse.ocl.pivot.DynamicProperty; -import org.eclipse.ocl.pivot.DynamicType; -import org.eclipse.ocl.pivot.DynamicValueSpecification; -import org.eclipse.ocl.pivot.Element; -import org.eclipse.ocl.pivot.ElementExtension; -import org.eclipse.ocl.pivot.EnumLiteralExp; -import org.eclipse.ocl.pivot.Enumeration; -import org.eclipse.ocl.pivot.EnumerationLiteral; -import org.eclipse.ocl.pivot.ExpressionInOCL; -import org.eclipse.ocl.pivot.Feature; -import org.eclipse.ocl.pivot.FeatureCallExp; -import org.eclipse.ocl.pivot.FinalState; -import org.eclipse.ocl.pivot.IfExp; -import org.eclipse.ocl.pivot.Import; -import org.eclipse.ocl.pivot.InstanceSpecification; -import org.eclipse.ocl.pivot.IntegerLiteralExp; -import org.eclipse.ocl.pivot.InvalidLiteralExp; -import org.eclipse.ocl.pivot.InvalidType; -import org.eclipse.ocl.pivot.IterateExp; -import org.eclipse.ocl.pivot.Iteration; -import org.eclipse.ocl.pivot.IteratorExp; -import org.eclipse.ocl.pivot.IteratorVariable; -import org.eclipse.ocl.pivot.LambdaType; -import org.eclipse.ocl.pivot.LanguageExpression; -import org.eclipse.ocl.pivot.LetExp; -import org.eclipse.ocl.pivot.LetVariable; -import org.eclipse.ocl.pivot.Library; -import org.eclipse.ocl.pivot.LiteralExp; -import org.eclipse.ocl.pivot.LoopExp; -import org.eclipse.ocl.pivot.MapLiteralExp; -import org.eclipse.ocl.pivot.MapLiteralPart; -import org.eclipse.ocl.pivot.MapType; -import org.eclipse.ocl.pivot.MessageExp; -import org.eclipse.ocl.pivot.MessageType; -import org.eclipse.ocl.pivot.Model; -import org.eclipse.ocl.pivot.NamedElement; -import org.eclipse.ocl.pivot.Namespace; -import org.eclipse.ocl.pivot.NavigationCallExp; -import org.eclipse.ocl.pivot.NullLiteralExp; -import org.eclipse.ocl.pivot.NumericLiteralExp; -import org.eclipse.ocl.pivot.OCLExpression; -import org.eclipse.ocl.pivot.Operation; -import org.eclipse.ocl.pivot.OperationCallExp; -import org.eclipse.ocl.pivot.OppositePropertyCallExp; -import org.eclipse.ocl.pivot.OrderedSetType; -import org.eclipse.ocl.pivot.OrphanCompletePackage; -import org.eclipse.ocl.pivot.Parameter; -import org.eclipse.ocl.pivot.ParameterVariable; -import org.eclipse.ocl.pivot.PivotPackage; -import org.eclipse.ocl.pivot.Precedence; -import org.eclipse.ocl.pivot.PrimitiveCompletePackage; -import org.eclipse.ocl.pivot.PrimitiveLiteralExp; -import org.eclipse.ocl.pivot.PrimitiveType; -import org.eclipse.ocl.pivot.Profile; -import org.eclipse.ocl.pivot.ProfileApplication; -import org.eclipse.ocl.pivot.Property; -import org.eclipse.ocl.pivot.PropertyCallExp; -import org.eclipse.ocl.pivot.Pseudostate; -import org.eclipse.ocl.pivot.PseudostateKind; -import org.eclipse.ocl.pivot.RealLiteralExp; -import org.eclipse.ocl.pivot.ReferringElement; -import org.eclipse.ocl.pivot.Region; -import org.eclipse.ocl.pivot.ResultVariable; -import org.eclipse.ocl.pivot.SelfType; -import org.eclipse.ocl.pivot.SendSignalAction; -import org.eclipse.ocl.pivot.SequenceType; -import org.eclipse.ocl.pivot.SetType; -import org.eclipse.ocl.pivot.ShadowExp; -import org.eclipse.ocl.pivot.ShadowPart; -import org.eclipse.ocl.pivot.Signal; -import org.eclipse.ocl.pivot.Slot; -import org.eclipse.ocl.pivot.StandardLibrary; -import org.eclipse.ocl.pivot.State; -import org.eclipse.ocl.pivot.StateExp; -import org.eclipse.ocl.pivot.StateMachine; -import org.eclipse.ocl.pivot.Stereotype; -import org.eclipse.ocl.pivot.StereotypeExtender; -import org.eclipse.ocl.pivot.StringLiteralExp; -import org.eclipse.ocl.pivot.TemplateBinding; -import org.eclipse.ocl.pivot.TemplateParameter; -import org.eclipse.ocl.pivot.TemplateParameterSubstitution; -import org.eclipse.ocl.pivot.TemplateSignature; -import org.eclipse.ocl.pivot.TemplateableElement; -import org.eclipse.ocl.pivot.Transition; -import org.eclipse.ocl.pivot.TransitionKind; -import org.eclipse.ocl.pivot.Trigger; -import org.eclipse.ocl.pivot.TupleLiteralExp; -import org.eclipse.ocl.pivot.TupleLiteralPart; -import org.eclipse.ocl.pivot.TupleType; -import org.eclipse.ocl.pivot.Type; -import org.eclipse.ocl.pivot.TypeExp; -import org.eclipse.ocl.pivot.TypedElement; -import org.eclipse.ocl.pivot.UnlimitedNaturalLiteralExp; -import org.eclipse.ocl.pivot.UnspecifiedValueExp; -import org.eclipse.ocl.pivot.ValueSpecification; -import org.eclipse.ocl.pivot.Variable; -import org.eclipse.ocl.pivot.VariableDeclaration; -import org.eclipse.ocl.pivot.VariableExp; -import org.eclipse.ocl.pivot.Vertex; -import org.eclipse.ocl.pivot.VoidType; -import org.eclipse.ocl.pivot.WildcardType; +import org.eclipse.ocl.pivot.*; import org.eclipse.ocl.pivot.library.LibraryFeature; import org.eclipse.ocl.pivot.utilities.MorePivotable; import org.eclipse.ocl.pivot.utilities.Nameable; @@ -435,12 +308,20 @@ extends EObjectValidator { public static final int ITERATOR_EXP__VALIDATE_CLOSURE_HAS_ONE_ITERATOR = 32; /** + * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Closure Result Element Type Is Iterator Type' of 'Iterator Exp'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final int ITERATOR_EXP__VALIDATE_CLOSURE_RESULT_ELEMENT_TYPE_IS_ITERATOR_TYPE = 33; + + /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Closure Source Element Type Is Body Element Type' of 'Iterator Exp'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ - public static final int ITERATOR_EXP__VALIDATE_CLOSURE_SOURCE_ELEMENT_TYPE_IS_BODY_ELEMENT_TYPE = 33; + public static final int ITERATOR_EXP__VALIDATE_CLOSURE_SOURCE_ELEMENT_TYPE_IS_BODY_ELEMENT_TYPE = 34; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Closure Type Is Unique Collection' of 'Iterator Exp'. @@ -448,7 +329,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int ITERATOR_EXP__VALIDATE_CLOSURE_TYPE_IS_UNIQUE_COLLECTION = 34; + public static final int ITERATOR_EXP__VALIDATE_CLOSURE_TYPE_IS_UNIQUE_COLLECTION = 35; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Collect Element Type Is Flattened Body Type' of 'Iterator Exp'. @@ -456,7 +337,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int ITERATOR_EXP__VALIDATE_COLLECT_ELEMENT_TYPE_IS_FLATTENED_BODY_TYPE = 35; + public static final int ITERATOR_EXP__VALIDATE_COLLECT_ELEMENT_TYPE_IS_FLATTENED_BODY_TYPE = 36; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Collect Type Is Unordered' of 'Iterator Exp'. @@ -464,7 +345,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int ITERATOR_EXP__VALIDATE_COLLECT_TYPE_IS_UNORDERED = 36; + public static final int ITERATOR_EXP__VALIDATE_COLLECT_TYPE_IS_UNORDERED = 37; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Iterator Type Is Source Element Type' of 'Iterator Exp'. @@ -472,7 +353,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int ITERATOR_EXP__VALIDATE_ITERATOR_TYPE_IS_SOURCE_ELEMENT_TYPE = 37; + public static final int ITERATOR_EXP__VALIDATE_ITERATOR_TYPE_IS_SOURCE_ELEMENT_TYPE = 38; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Safe Iterator Is Required' of 'Iterator Exp'. @@ -480,7 +361,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int ITERATOR_EXP__VALIDATE_SAFE_ITERATOR_IS_REQUIRED = 38; + public static final int ITERATOR_EXP__VALIDATE_SAFE_ITERATOR_IS_REQUIRED = 39; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Safe Source Can Be Null' of 'Iterator Exp'. @@ -488,7 +369,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int ITERATOR_EXP__VALIDATE_SAFE_SOURCE_CAN_BE_NULL = 39; + public static final int ITERATOR_EXP__VALIDATE_SAFE_SOURCE_CAN_BE_NULL = 40; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Sorted By Element Type Is Source Element Type' of 'Iterator Exp'. @@ -496,7 +377,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int ITERATOR_EXP__VALIDATE_SORTED_BY_ELEMENT_TYPE_IS_SOURCE_ELEMENT_TYPE = 40; + public static final int ITERATOR_EXP__VALIDATE_SORTED_BY_ELEMENT_TYPE_IS_SOURCE_ELEMENT_TYPE = 41; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Sorted By Is Ordered If Source Is Ordered' of 'Iterator Exp'. @@ -504,7 +385,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int ITERATOR_EXP__VALIDATE_SORTED_BY_IS_ORDERED_IF_SOURCE_IS_ORDERED = 41; + public static final int ITERATOR_EXP__VALIDATE_SORTED_BY_IS_ORDERED_IF_SOURCE_IS_ORDERED = 42; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Sorted By Iterator Type Is Comparable' of 'Iterator Exp'. @@ -512,7 +393,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int ITERATOR_EXP__VALIDATE_SORTED_BY_ITERATOR_TYPE_IS_COMPARABLE = 42; + public static final int ITERATOR_EXP__VALIDATE_SORTED_BY_ITERATOR_TYPE_IS_COMPARABLE = 43; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Unsafe Source Can Not Be Null' of 'Iterator Exp'. @@ -520,7 +401,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int ITERATOR_EXP__VALIDATE_UNSAFE_SOURCE_CAN_NOT_BE_NULL = 43; + public static final int ITERATOR_EXP__VALIDATE_UNSAFE_SOURCE_CAN_NOT_BE_NULL = 44; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Has No Initializer' of 'Iterator Variable'. @@ -528,7 +409,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int ITERATOR_VARIABLE__VALIDATE_HAS_NO_INITIALIZER = 44; + public static final int ITERATOR_VARIABLE__VALIDATE_HAS_NO_INITIALIZER = 45; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Compatible Nullity For In' of 'Let Exp'. @@ -536,7 +417,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int LET_EXP__VALIDATE_COMPATIBLE_NULLITY_FOR_IN = 45; + public static final int LET_EXP__VALIDATE_COMPATIBLE_NULLITY_FOR_IN = 46; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Type Is In Type' of 'Let Exp'. @@ -544,7 +425,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int LET_EXP__VALIDATE_TYPE_IS_IN_TYPE = 46; + public static final int LET_EXP__VALIDATE_TYPE_IS_IN_TYPE = 47; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Type Is Not Invalid' of 'Let Exp'. @@ -552,7 +433,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int LET_EXP__VALIDATE_TYPE_IS_NOT_INVALID = 47; + public static final int LET_EXP__VALIDATE_TYPE_IS_NOT_INVALID = 48; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Compatible Nullity For Initializer' of 'Let Variable'. @@ -560,7 +441,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int LET_VARIABLE__VALIDATE_COMPATIBLE_NULLITY_FOR_INITIALIZER = 48; + public static final int LET_VARIABLE__VALIDATE_COMPATIBLE_NULLITY_FOR_INITIALIZER = 49; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Compatible Type For Initializer' of 'Let Variable'. @@ -568,7 +449,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int LET_VARIABLE__VALIDATE_COMPATIBLE_TYPE_FOR_INITIALIZER = 49; + public static final int LET_VARIABLE__VALIDATE_COMPATIBLE_TYPE_FOR_INITIALIZER = 50; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Has Initializer' of 'Let Variable'. @@ -576,7 +457,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int LET_VARIABLE__VALIDATE_HAS_INITIALIZER = 50; + public static final int LET_VARIABLE__VALIDATE_HAS_INITIALIZER = 51; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate No Initializers' of 'Loop Exp'. @@ -584,7 +465,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int LOOP_EXP__VALIDATE_NO_INITIALIZERS = 51; + public static final int LOOP_EXP__VALIDATE_NO_INITIALIZERS = 52; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Source Is Collection' of 'Loop Exp'. @@ -592,7 +473,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int LOOP_EXP__VALIDATE_SOURCE_IS_COLLECTION = 52; + public static final int LOOP_EXP__VALIDATE_SOURCE_IS_COLLECTION = 53; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate One Call Or One Send' of 'Message Exp'. @@ -600,7 +481,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int MESSAGE_EXP__VALIDATE_ONE_CALL_OR_ONE_SEND = 53; + public static final int MESSAGE_EXP__VALIDATE_ONE_CALL_OR_ONE_SEND = 54; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Target Is Not ACollection' of 'Message Exp'. @@ -608,7 +489,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int MESSAGE_EXP__VALIDATE_TARGET_IS_NOT_ACOLLECTION = 54; + public static final int MESSAGE_EXP__VALIDATE_TARGET_IS_NOT_ACOLLECTION = 55; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Type Is Not Null' of 'OCL Expression'. @@ -616,7 +497,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int OCL_EXPRESSION__VALIDATE_TYPE_IS_NOT_NULL = 55; + public static final int OCL_EXPRESSION__VALIDATE_TYPE_IS_NOT_NULL = 56; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Compatible Return' of 'Operation'. @@ -624,7 +505,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int OPERATION__VALIDATE_COMPATIBLE_RETURN = 56; + public static final int OPERATION__VALIDATE_COMPATIBLE_RETURN = 57; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Loadable Implementation' of 'Operation'. @@ -632,7 +513,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int OPERATION__VALIDATE_LOADABLE_IMPLEMENTATION = 57; + public static final int OPERATION__VALIDATE_LOADABLE_IMPLEMENTATION = 58; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Unique Postcondition Name' of 'Operation'. @@ -640,7 +521,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int OPERATION__VALIDATE_UNIQUE_POSTCONDITION_NAME = 58; + public static final int OPERATION__VALIDATE_UNIQUE_POSTCONDITION_NAME = 59; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Unique Precondition Name' of 'Operation'. @@ -648,7 +529,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int OPERATION__VALIDATE_UNIQUE_PRECONDITION_NAME = 59; + public static final int OPERATION__VALIDATE_UNIQUE_PRECONDITION_NAME = 60; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Argument Count' of 'Operation Call Exp'. @@ -656,7 +537,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int OPERATION_CALL_EXP__VALIDATE_ARGUMENT_COUNT = 60; + public static final int OPERATION_CALL_EXP__VALIDATE_ARGUMENT_COUNT = 61; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Argument Type Is Conformant' of 'Operation Call Exp'. @@ -664,7 +545,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int OPERATION_CALL_EXP__VALIDATE_ARGUMENT_TYPE_IS_CONFORMANT = 61; + public static final int OPERATION_CALL_EXP__VALIDATE_ARGUMENT_TYPE_IS_CONFORMANT = 62; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Safe Source Can Be Null' of 'Operation Call Exp'. @@ -672,7 +553,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int OPERATION_CALL_EXP__VALIDATE_SAFE_SOURCE_CAN_BE_NULL = 62; + public static final int OPERATION_CALL_EXP__VALIDATE_SAFE_SOURCE_CAN_BE_NULL = 63; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Has No Initializer' of 'Parameter Variable'. @@ -680,7 +561,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int PARAMETER_VARIABLE__VALIDATE_HAS_NO_INITIALIZER = 63; + public static final int PARAMETER_VARIABLE__VALIDATE_HAS_NO_INITIALIZER = 64; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Compatible Default Expression' of 'Property'. @@ -688,7 +569,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int PROPERTY__VALIDATE_COMPATIBLE_DEFAULT_EXPRESSION = 64; + public static final int PROPERTY__VALIDATE_COMPATIBLE_DEFAULT_EXPRESSION = 65; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Compatible Result Type' of 'Property Call Exp'. @@ -696,7 +577,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int PROPERTY_CALL_EXP__VALIDATE_COMPATIBLE_RESULT_TYPE = 65; + public static final int PROPERTY_CALL_EXP__VALIDATE_COMPATIBLE_RESULT_TYPE = 66; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Non Static Source Type Is Conformant' of 'Property Call Exp'. @@ -704,7 +585,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int PROPERTY_CALL_EXP__VALIDATE_NON_STATIC_SOURCE_TYPE_IS_CONFORMANT = 66; + public static final int PROPERTY_CALL_EXP__VALIDATE_NON_STATIC_SOURCE_TYPE_IS_CONFORMANT = 67; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Safe Source Can Be Null' of 'Property Call Exp'. @@ -712,7 +593,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int PROPERTY_CALL_EXP__VALIDATE_SAFE_SOURCE_CAN_BE_NULL = 67; + public static final int PROPERTY_CALL_EXP__VALIDATE_SAFE_SOURCE_CAN_BE_NULL = 68; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Unsafe Source Can Not Be Null' of 'Property Call Exp'. @@ -720,7 +601,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int PROPERTY_CALL_EXP__VALIDATE_UNSAFE_SOURCE_CAN_NOT_BE_NULL = 68; + public static final int PROPERTY_CALL_EXP__VALIDATE_UNSAFE_SOURCE_CAN_NOT_BE_NULL = 69; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Compatible Nullity For Initializer' of 'Result Variable'. @@ -728,7 +609,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int RESULT_VARIABLE__VALIDATE_COMPATIBLE_NULLITY_FOR_INITIALIZER = 69; + public static final int RESULT_VARIABLE__VALIDATE_COMPATIBLE_NULLITY_FOR_INITIALIZER = 70; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Compatible Type For Initializer' of 'Result Variable'. @@ -736,7 +617,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int RESULT_VARIABLE__VALIDATE_COMPATIBLE_TYPE_FOR_INITIALIZER = 70; + public static final int RESULT_VARIABLE__VALIDATE_COMPATIBLE_TYPE_FOR_INITIALIZER = 71; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Has Initializer' of 'Result Variable'. @@ -744,7 +625,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int RESULT_VARIABLE__VALIDATE_HAS_INITIALIZER = 71; + public static final int RESULT_VARIABLE__VALIDATE_HAS_INITIALIZER = 72; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Class Has No String Value Initializer' of 'Shadow Exp'. @@ -752,7 +633,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int SHADOW_EXP__VALIDATE_CLASS_HAS_NO_STRING_VALUE_INITIALIZER = 72; + public static final int SHADOW_EXP__VALIDATE_CLASS_HAS_NO_STRING_VALUE_INITIALIZER = 73; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Data Type Has No Part Initializers' of 'Shadow Exp'. @@ -760,7 +641,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int SHADOW_EXP__VALIDATE_DATA_TYPE_HAS_NO_PART_INITIALIZERS = 73; + public static final int SHADOW_EXP__VALIDATE_DATA_TYPE_HAS_NO_PART_INITIALIZERS = 74; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Data Type Has One Part Initializer' of 'Shadow Exp'. @@ -768,7 +649,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int SHADOW_EXP__VALIDATE_DATA_TYPE_HAS_ONE_PART_INITIALIZER = 74; + public static final int SHADOW_EXP__VALIDATE_DATA_TYPE_HAS_ONE_PART_INITIALIZER = 75; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Data Type Has String Value Initializer' of 'Shadow Exp'. @@ -776,7 +657,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int SHADOW_EXP__VALIDATE_DATA_TYPE_HAS_STRING_VALUE_INITIALIZER = 75; + public static final int SHADOW_EXP__VALIDATE_DATA_TYPE_HAS_STRING_VALUE_INITIALIZER = 76; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Initializes All Class Properties' of 'Shadow Exp'. @@ -784,7 +665,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int SHADOW_EXP__VALIDATE_INITIALIZES_ALL_CLASS_PROPERTIES = 76; + public static final int SHADOW_EXP__VALIDATE_INITIALIZES_ALL_CLASS_PROPERTIES = 77; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Type Is Not Invalid' of 'Shadow Exp'. @@ -792,7 +673,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int SHADOW_EXP__VALIDATE_TYPE_IS_NOT_INVALID = 77; + public static final int SHADOW_EXP__VALIDATE_TYPE_IS_NOT_INVALID = 78; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Compatible Initialiser Type' of 'Shadow Part'. @@ -800,7 +681,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int SHADOW_PART__VALIDATE_COMPATIBLE_INITIALISER_TYPE = 78; + public static final int SHADOW_PART__VALIDATE_COMPATIBLE_INITIALISER_TYPE = 79; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Type Is Not Invalid' of 'Shadow Part'. @@ -808,7 +689,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int SHADOW_PART__VALIDATE_TYPE_IS_NOT_INVALID = 79; + public static final int SHADOW_PART__VALIDATE_TYPE_IS_NOT_INVALID = 80; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Type Is Not Null' of 'Shadow Part'. @@ -816,7 +697,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int SHADOW_PART__VALIDATE_TYPE_IS_NOT_NULL = 80; + public static final int SHADOW_PART__VALIDATE_TYPE_IS_NOT_NULL = 81; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Type Is Not Invalid' of 'State Exp'. @@ -824,7 +705,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int STATE_EXP__VALIDATE_TYPE_IS_NOT_INVALID = 81; + public static final int STATE_EXP__VALIDATE_TYPE_IS_NOT_INVALID = 82; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Compatible Initialiser Type' of 'Tuple Literal Part'. @@ -832,7 +713,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int TUPLE_LITERAL_PART__VALIDATE_COMPATIBLE_INITIALISER_TYPE = 82; + public static final int TUPLE_LITERAL_PART__VALIDATE_COMPATIBLE_INITIALISER_TYPE = 83; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Type Is Not Invalid' of 'Tuple Literal Part'. @@ -840,7 +721,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int TUPLE_LITERAL_PART__VALIDATE_TYPE_IS_NOT_INVALID = 83; + public static final int TUPLE_LITERAL_PART__VALIDATE_TYPE_IS_NOT_INVALID = 84; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Compatible Initialiser Type' of 'Variable'. @@ -848,7 +729,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int VARIABLE__VALIDATE_COMPATIBLE_INITIALISER_TYPE = 84; + public static final int VARIABLE__VALIDATE_COMPATIBLE_INITIALISER_TYPE = 85; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Name Is Not Null' of 'Variable Declaration'. @@ -856,7 +737,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int VARIABLE_DECLARATION__VALIDATE_NAME_IS_NOT_NULL = 85; + public static final int VARIABLE_DECLARATION__VALIDATE_NAME_IS_NOT_NULL = 86; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Type Is Not Invalid' of 'Variable Declaration'. @@ -864,7 +745,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int VARIABLE_DECLARATION__VALIDATE_TYPE_IS_NOT_INVALID = 86; + public static final int VARIABLE_DECLARATION__VALIDATE_TYPE_IS_NOT_INVALID = 87; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Type Is Not Null' of 'Variable Declaration'. @@ -872,7 +753,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int VARIABLE_DECLARATION__VALIDATE_TYPE_IS_NOT_NULL = 87; + public static final int VARIABLE_DECLARATION__VALIDATE_TYPE_IS_NOT_NULL = 88; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Type Is Not Invalid' of 'Variable Exp'. @@ -880,7 +761,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int VARIABLE_EXP__VALIDATE_TYPE_IS_NOT_INVALID = 88; + public static final int VARIABLE_EXP__VALIDATE_TYPE_IS_NOT_INVALID = 89; /** * A constant with a fixed name that can be used as the base value for additional hand written constants. @@ -888,7 +769,7 @@ extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 88; + private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 89; /** * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class. @@ -2879,6 +2760,7 @@ extends EObjectValidator { if (result || diagnostics != null) result &= validateIteratorExp_validateClosureBodyTypeIsConformanttoIteratorType(iteratorExp, diagnostics, context); if (result || diagnostics != null) result &= validateIteratorExp_validateClosureElementTypeIsSourceElementType(iteratorExp, diagnostics, context); if (result || diagnostics != null) result &= validateIteratorExp_validateClosureHasOneIterator(iteratorExp, diagnostics, context); + if (result || diagnostics != null) result &= validateIteratorExp_validateClosureResultElementTypeIsIteratorType(iteratorExp, diagnostics, context); if (result || diagnostics != null) result &= validateIteratorExp_validateClosureSourceElementTypeIsBodyElementType(iteratorExp, diagnostics, context); if (result || diagnostics != null) result &= validateIteratorExp_validateClosureTypeIsUniqueCollection(iteratorExp, diagnostics, context); if (result || diagnostics != null) result &= validateIteratorExp_validateCollectElementTypeIsFlattenedBodyType(iteratorExp, diagnostics, context); @@ -3084,6 +2966,17 @@ extends EObjectValidator { } /** + * Validates the validateClosureResultElementTypeIsIteratorType constraint of '<em>Iterator Exp</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateIteratorExp_validateClosureResultElementTypeIsIteratorType(IteratorExp iteratorExp, DiagnosticChain diagnostics, Map<Object, Object> context) + { + return iteratorExp.validateClosureResultElementTypeIsIteratorType(diagnostics, context); + } + + /** * Validates the validateAnyBodyTypeIsBoolean constraint of '<em>Iterator Exp</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/plugins/org.eclipse.ocl.pivot/model-gen/Pivot.oclas b/plugins/org.eclipse.ocl.pivot/model-gen/Pivot.oclas index c86f6fb183..621a6a8faa 100644 --- a/plugins/org.eclipse.ocl.pivot/model-gen/Pivot.oclas +++ b/plugins/org.eclipse.ocl.pivot/model-gen/Pivot.oclas @@ -383,7 +383,7 @@ </ownedClasses> <ownedClasses xmi:id="AprzZ" name="IteratorExp" superClasses="#KhrnS #dXAFV"> <ownedInvariants xmi:id="uX2KR" isCallable="true" name="AnyBodyTypeIsBoolean"> - <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="name = 'any' implies ownedBody.type = 'Boolean'

"/> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="name = 'any' implies ownedBody.type = Boolean

"/> </ownedInvariants> <ownedInvariants xmi:id="+IUau" isCallable="true" name="AnyHasOneIterator"> <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="name = 'any' implies ownedIterators->size() = 1

"/> @@ -392,19 +392,22 @@ <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="name = 'any' implies type = ownedSource?.type?.oclAsType(CollectionType)?.elementType

"/> </ownedInvariants> <ownedInvariants xmi:id="DSk3n" isCallable="true" name="ClosureBodyElementTypeIsIteratorType"> - <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
	name = 'closure' implies
		let bodyElementType = ownedBody.type.oclAsType(CollectionType).elementType in 
		let iteratorType = ownedIterators->at(1).type in
			bodyElementType.conformsTo(iteratorType)

"/> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="name = 'closure' implies
	let bodyElementType = if ownedBody.type.oclIsKindOf(CollectionType) then ownedBody.type.oclAsType(CollectionType).elementType else ownedBody.type endif in 
	let iteratorType = ownedIterators->at(1).type in
	bodyElementType.conformsTo(iteratorType)

"/> </ownedInvariants> <ownedInvariants xmi:id="9srpT" isCallable="true" name="ClosureBodyTypeIsConformanttoIteratorType"> - <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
	true
"/> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
	true "/> </ownedInvariants> <ownedInvariants xmi:id="OlB4W" isCallable="true" name="ClosureElementTypeIsSourceElementType"> - <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="name = 'closure' implies
type.oclAsType(CollectionType).elementType
= ownedSource?.type.oclAsType(CollectionType).elementType
"/> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body=" true "/> </ownedInvariants> <ownedInvariants xmi:id="NxSxQ" isCallable="true" name="ClosureHasOneIterator"> <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="name = 'closure' implies ownedIterators->size() = 1

"/> </ownedInvariants> + <ownedInvariants xmi:id="oEhWV" isCallable="true" name="ClosureResultElementTypeIsIteratorType"> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
	name = 'closure' implies
		let resultElementType = type.oclAsType(CollectionType).elementType in 
		let iteratorType = ownedIterators->at(1).type in
		iteratorType.conformsTo(resultElementType)

"/> + </ownedInvariants> <ownedInvariants xmi:id="i2WeK" isCallable="true" name="ClosureSourceElementTypeIsBodyElementType"> - <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="name = 'closure' implies
ownedSource?.type.oclAsType(CollectionType).elementType =
if ownedBody.type.oclIsKindOf(CollectionType)
then ownedBody.type.oclAsType(CollectionType).elementType
else ownedBody.type
endif

"/> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="true "/> </ownedInvariants> <ownedInvariants xmi:id="G7Q4a" isCallable="true" name="ClosureTypeIsUniqueCollection"> <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="name = 'closure' implies
if ownedSource?.type?.oclIsKindOf(SequenceType) or ownedSource?.type.oclIsKindOf(OrderedSetType) then
type.oclIsKindOf(OrderedSetType)
else
type.oclIsKindOf(SetType)
endif

"/> @@ -425,7 +428,7 @@ <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="isSafe implies not ownedSource?.type.oclAsType(CollectionType).isNullFree
"/> </ownedInvariants> <ownedInvariants xmi:id="HG8Sn" isCallable="true" name="SortedByElementTypeIsSourceElementType"> - <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="name = 'sortedBy' implies
type.oclAsType(CollectionType).elementType =
ownedBody.type.oclAsType(CollectionType).elementType

"/> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="name = 'sortedBy' implies
type.oclAsType(CollectionType).elementType =
ownedSource?.type.oclAsType(CollectionType).elementType

"/> </ownedInvariants> <ownedInvariants xmi:id="UgAQH" isCallable="true" name="SortedByIsOrderedIfSourceIsOrdered"> <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="name = 'sortedBy' implies
if ownedSource?.type.oclIsKindOf(SequenceType) or ownedSource?.type.oclIsKindOf(BagType) then
type.oclIsKindOf(SequenceType)
else
type.oclIsKindOf(OrderedSetType)
endif

"/> diff --git a/plugins/org.eclipse.ocl.pivot/model/Pivot.ecore b/plugins/org.eclipse.ocl.pivot/model/Pivot.ecore index 4504905511..f5f14781de 100644 --- a/plugins/org.eclipse.ocl.pivot/model/Pivot.ecore +++ b/plugins/org.eclipse.ocl.pivot/model/Pivot.ecore @@ -964,7 +964,7 @@ eSuperTypes="#T-pivot-LoopExp #T-pivot-ReferringElement"> <eOperations name="validateAnyBodyTypeIsBoolean" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="name = 'any' implies ownedBody.type = 'Boolean'

"/> + <details key="body" value="name = 'any' implies ownedBody.type = Boolean

"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/uml2/2.0.0/UML"> <details key="originalName" value="AnyBodyTypeIsBoolean"/> @@ -1009,7 +1009,7 @@ </eOperations> <eOperations name="validateClosureBodyElementTypeIsIteratorType" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="
	name = 'closure' implies
		let bodyElementType = ownedBody.type.oclAsType(CollectionType).elementType in 
		let iteratorType = ownedIterators->at(1).type in
			bodyElementType.conformsTo(iteratorType)

"/> + <details key="body" value="name = 'closure' implies
	let bodyElementType = if ownedBody.type.oclIsKindOf(CollectionType) then ownedBody.type.oclAsType(CollectionType).elementType else ownedBody.type endif in 
	let iteratorType = ownedIterators->at(1).type in
	bodyElementType.conformsTo(iteratorType)

"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/uml2/2.0.0/UML"> <details key="originalName" value="ClosureBodyElementTypeIsIteratorType"/> @@ -1024,7 +1024,7 @@ </eOperations> <eOperations name="validateClosureBodyTypeIsConformanttoIteratorType" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="
	true
"/> + <details key="body" value="
	true "/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/uml2/2.0.0/UML"> <details key="originalName" value="ClosureBodyTypeIsConformanttoIteratorType"/> @@ -1039,7 +1039,7 @@ </eOperations> <eOperations name="validateClosureElementTypeIsSourceElementType" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="name = 'closure' implies
type.oclAsType(CollectionType).elementType
= ownedSource?.type.oclAsType(CollectionType).elementType
"/> + <details key="body" value=" true "/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/uml2/2.0.0/UML"> <details key="originalName" value="ClosureElementTypeIsSourceElementType"/> @@ -1067,9 +1067,24 @@ </eGenericType> </eParameters> </eOperations> + <eOperations name="validateClosureResultElementTypeIsIteratorType" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="body" value="
	name = 'closure' implies
		let resultElementType = type.oclAsType(CollectionType).elementType in 
		let iteratorType = ownedIterators->at(1).type in
		iteratorType.conformsTo(resultElementType)

"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/uml2/2.0.0/UML"> + <details key="originalName" value="ClosureResultElementTypeIsIteratorType"/> + </eAnnotations> + <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> + <eParameters name="context"> + <eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EMap"> + <eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/> + <eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/> + </eGenericType> + </eParameters> + </eOperations> <eOperations name="validateClosureSourceElementTypeIsBodyElementType" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="name = 'closure' implies
ownedSource?.type.oclAsType(CollectionType).elementType =
if ownedBody.type.oclIsKindOf(CollectionType)
then ownedBody.type.oclAsType(CollectionType).elementType
else ownedBody.type
endif

"/> + <details key="body" value="true "/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/uml2/2.0.0/UML"> <details key="originalName" value="ClosureSourceElementTypeIsBodyElementType"/> @@ -1174,7 +1189,7 @@ </eOperations> <eOperations name="validateSortedByElementTypeIsSourceElementType" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="name = 'sortedBy' implies
type.oclAsType(CollectionType).elementType =
ownedBody.type.oclAsType(CollectionType).elementType

"/> + <details key="body" value="name = 'sortedBy' implies
type.oclAsType(CollectionType).elementType =
ownedSource?.type.oclAsType(CollectionType).elementType

"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/uml2/2.0.0/UML"> <details key="originalName" value="SortedByElementTypeIsSourceElementType"/> diff --git a/plugins/org.eclipse.ocl.pivot/model/Pivot.genmodel b/plugins/org.eclipse.ocl.pivot/model/Pivot.genmodel index 3d6aa901d0..d585ce4353 100644 --- a/plugins/org.eclipse.ocl.pivot/model/Pivot.genmodel +++ b/plugins/org.eclipse.ocl.pivot/model/Pivot.genmodel @@ -394,6 +394,10 @@ <genParameters ecoreParameter="Pivot.ecore#//IteratorExp/validateClosureHasOneIterator/diagnostics"/> <genParameters ecoreParameter="Pivot.ecore#//IteratorExp/validateClosureHasOneIterator/context"/> </genOperations> + <genOperations ecoreOperation="Pivot.ecore#//IteratorExp/validateClosureResultElementTypeIsIteratorType"> + <genParameters ecoreParameter="Pivot.ecore#//IteratorExp/validateClosureResultElementTypeIsIteratorType/diagnostics"/> + <genParameters ecoreParameter="Pivot.ecore#//IteratorExp/validateClosureResultElementTypeIsIteratorType/context"/> + </genOperations> <genOperations ecoreOperation="Pivot.ecore#//IteratorExp/validateClosureSourceElementTypeIsBodyElementType"> <genParameters ecoreParameter="Pivot.ecore#//IteratorExp/validateClosureSourceElementTypeIsBodyElementType/diagnostics"/> <genParameters ecoreParameter="Pivot.ecore#//IteratorExp/validateClosureSourceElementTypeIsBodyElementType/context"/> |