|
Lines 9-15
Link Here
|
| 9 |
* Borland Software Corporation - initial API and implementation |
9 |
* Borland Software Corporation - initial API and implementation |
| 10 |
* Christopher Gerking - bugs 302594, 310991 |
10 |
* Christopher Gerking - bugs 302594, 310991 |
| 11 |
* Alex Paperno - bugs 272869, 268636, 404647, 414363, 414363, 401521, |
11 |
* Alex Paperno - bugs 272869, 268636, 404647, 414363, 414363, 401521, |
| 12 |
* 419299 |
12 |
* 419299, 403440 |
| 13 |
*******************************************************************************/ |
13 |
*******************************************************************************/ |
| 14 |
package org.eclipse.m2m.internal.qvt.oml.ast.parser; |
14 |
package org.eclipse.m2m.internal.qvt.oml.ast.parser; |
| 15 |
|
15 |
|
|
Lines 3725-3732
Link Here
|
| 3725 |
/** |
3725 |
/** |
| 3726 |
* TODO - make a common resolution operation, reusable in for ResolveInExp too. |
3726 |
* TODO - make a common resolution operation, reusable in for ResolveInExp too. |
| 3727 |
*/ |
3727 |
*/ |
| 3728 |
private List<EOperation> resolveMappingOperationReference(ScopedNameCS identifierCS, QvtOperationalEnv env) { |
3728 |
private List<MappingOperation> resolveMappingOperationReference(ScopedNameCS identifierCS, QvtOperationalEnv env) { |
| 3729 |
List<EOperation> result = Collections.emptyList(); |
3729 |
List<MappingOperation> result = Collections.emptyList(); |
| 3730 |
|
3730 |
|
| 3731 |
TypeCS typeCS = identifierCS.getTypeCS(); |
3731 |
TypeCS typeCS = identifierCS.getTypeCS(); |
| 3732 |
EClassifier owningType = null; |
3732 |
EClassifier owningType = null; |
|
Lines 3742-3749
Link Here
|
| 3742 |
} |
3742 |
} |
| 3743 |
// filter out inherited mappings |
3743 |
// filter out inherited mappings |
| 3744 |
if(!result.isEmpty()) { |
3744 |
if(!result.isEmpty()) { |
| 3745 |
List<EOperation> ownerLocalOpers = new ArrayList<EOperation>(result.size()); |
3745 |
List<MappingOperation> ownerLocalOpers = new ArrayList<MappingOperation>(result.size()); |
| 3746 |
for (EOperation operation : result) { |
3746 |
for (MappingOperation operation : result) { |
| 3747 |
EClassifier owner = env.getUMLReflection().getOwningClassifier(operation); |
3747 |
EClassifier owner = env.getUMLReflection().getOwningClassifier(operation); |
| 3748 |
if ((typeCS == null && owner == null) || (TypeUtil.resolveType(env, owner) == owningType)) { |
3748 |
if ((typeCS == null && owner == null) || (TypeUtil.resolveType(env, owner) == owningType)) { |
| 3749 |
ownerLocalOpers.add(operation); |
3749 |
ownerLocalOpers.add(operation); |
|
Lines 3774-3783
Link Here
|
| 3774 |
MappingExtensionKindCS kind = extensionCS.getKind(); |
3774 |
MappingExtensionKindCS kind = extensionCS.getKind(); |
| 3775 |
|
3775 |
|
| 3776 |
for (ScopedNameCS identifierCS : extensionCS.getMappingIdentifiers()) { |
3776 |
for (ScopedNameCS identifierCS : extensionCS.getMappingIdentifiers()) { |
| 3777 |
List<EOperation> mappings = resolveMappingOperationReference(identifierCS, env); |
3777 |
List<MappingOperation> mappings = resolveMappingOperationReference(identifierCS, env); |
| 3778 |
if(mappings.size() == 1) { |
3778 |
if(mappings.size() == 1) { |
| 3779 |
boolean isAdded = false; |
3779 |
boolean isAdded = false; |
| 3780 |
MappingOperation extendedMapping = (MappingOperation)mappings.get(0); |
3780 |
MappingOperation extendedMapping = mappings.get(0); |
| 3781 |
if(kind == MappingExtensionKindCS.INHERITS) { |
3781 |
if(kind == MappingExtensionKindCS.INHERITS) { |
| 3782 |
isAdded = operation.getInherited().add(extendedMapping); |
3782 |
isAdded = operation.getInherited().add(extendedMapping); |
| 3783 |
MappingExtensionHelper.bind2SourceElement(operation, identifierCS, kind); |
3783 |
MappingExtensionHelper.bind2SourceElement(operation, identifierCS, kind); |
|
Lines 4564-4577
Link Here
|
| 4564 |
EClassifier eClassifier = (contextTypeCS == null) ? null : visitTypeCS(contextTypeCS, null, env); // mapping context type |
4564 |
EClassifier eClassifier = (contextTypeCS == null) ? null : visitTypeCS(contextTypeCS, null, env); // mapping context type |
| 4565 |
eClassifier = eClassifier != null ? eClassifier : env.getModuleContextType(); |
4565 |
eClassifier = eClassifier != null ? eClassifier : env.getModuleContextType(); |
| 4566 |
String mappingName = resolveInExpCS.getInMappingName().getValue(); |
4566 |
String mappingName = resolveInExpCS.getInMappingName().getValue(); |
| 4567 |
List<EOperation> rawMappingOperations = env.lookupMappingOperations(eClassifier, mappingName); |
4567 |
List<MappingOperation> rawMappingOperations = env.lookupMappingOperations(eClassifier, mappingName); |
| 4568 |
List<EOperation> mappingOperations = new ArrayList<EOperation>(); |
4568 |
List<MappingOperation> unfilteredMappingOperations = new ArrayList<MappingOperation>(); |
|
|
4569 |
List<MappingOperation> mappingOperations = new ArrayList<MappingOperation>(); |
| 4569 |
|
4570 |
|
| 4570 |
for (EOperation operation : rawMappingOperations) { |
4571 |
for (MappingOperation operation : rawMappingOperations) { |
| 4571 |
EClassifier owner = env.getUMLReflection().getOwningClassifier(operation); |
4572 |
EClassifier owner = env.getUMLReflection().getOwningClassifier(operation); |
| 4572 |
if (((contextTypeCS == null) && (owner == null)) |
4573 |
if (((contextTypeCS == null) && (owner == null)) |
| 4573 |
|| (TypeUtil.resolveType(env, owner) == eClassifier)) { |
4574 |
|| (TypeUtil.resolveType(env, owner) == eClassifier)) { |
| 4574 |
mappingOperations.add(operation); |
4575 |
unfilteredMappingOperations.add(operation); |
|
|
4576 |
} |
| 4577 |
} |
| 4578 |
mappingOperations.addAll(unfilteredMappingOperations); |
| 4579 |
for (MappingOperation operation : unfilteredMappingOperations) { |
| 4580 |
if (unfilteredMappingOperations.contains(operation.getOverridden())) { |
| 4581 |
mappingOperations.remove(operation.getOverridden()); |
| 4575 |
} |
4582 |
} |
| 4576 |
} |
4583 |
} |
| 4577 |
if (mappingOperations.size() == 1) { |
4584 |
if (mappingOperations.size() == 1) { |