Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 237662 Details for
Bug 403440
resolveoneIn(...) fails for override mappings in extending module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
The patch implements the proposed filter
bug403440.patch (text/plain), 6.19 KB, created by
Alex Paperno
on 2013-11-23 20:51:58 EST
(
hide
)
Description:
The patch implements the proposed filter
Filename:
MIME Type:
Creator:
Alex Paperno
Created:
2013-11-23 20:51:58 EST
Size:
6.19 KB
patch
obsolete
>diff --git a/plugins/org.eclipse.m2m.qvt.oml/src/org/eclipse/m2m/internal/qvt/oml/ast/env/QvtOperationalEnv.java b/plugins/org.eclipse.m2m.qvt.oml/src/org/eclipse/m2m/internal/qvt/oml/ast/env/QvtOperationalEnv.java >index 630cf10..d6b9d24 100644 >--- a/plugins/org.eclipse.m2m.qvt.oml/src/org/eclipse/m2m/internal/qvt/oml/ast/env/QvtOperationalEnv.java >+++ b/plugins/org.eclipse.m2m.qvt.oml/src/org/eclipse/m2m/internal/qvt/oml/ast/env/QvtOperationalEnv.java >@@ -8,7 +8,7 @@ > * > * Contributors: > * Borland Software Corporation - initial API and implementation >- * Alex Paperno - bugs 416584, 401521 >+ * Alex Paperno - bugs 416584, 401521, 403440 > *******************************************************************************/ > package org.eclipse.m2m.internal.qvt.oml.ast.env; > >@@ -258,7 +258,7 @@ > return TypeUtil.findOperationMatching(this, owner, name, args); > } > >- public List<EOperation> lookupMappingOperations(EClassifier owner, String name) { >+ public List<MappingOperation> lookupMappingOperations(EClassifier owner, String name) { > if (owner == null) { > owner = getModuleContextType(); > if(owner == null) { >@@ -268,10 +268,10 @@ > > UMLReflection<EPackage, EClassifier, EOperation, EStructuralFeature, EEnumLiteral, EParameter, EObject, CallOperationAction, SendSignalAction, Constraint> uml = getUMLReflection(); > List<EOperation> operations = TypeUtil.getOperations(this, owner); >- List<EOperation> result = new ArrayList<EOperation>(); >+ List<MappingOperation> result = new ArrayList<MappingOperation>(); > for (EOperation operation : operations) { > if (uml.getName(operation).equals(name) && QvtOperationalUtil.isMappingOperation(operation)) { >- result.add(operation); >+ result.add((MappingOperation)operation); > } > } > >diff --git a/plugins/org.eclipse.m2m.qvt.oml/src/org/eclipse/m2m/internal/qvt/oml/ast/parser/QvtOperationalVisitorCS.java b/plugins/org.eclipse.m2m.qvt.oml/src/org/eclipse/m2m/internal/qvt/oml/ast/parser/QvtOperationalVisitorCS.java >index e0afaae..709d674 100644 >--- a/plugins/org.eclipse.m2m.qvt.oml/src/org/eclipse/m2m/internal/qvt/oml/ast/parser/QvtOperationalVisitorCS.java >+++ b/plugins/org.eclipse.m2m.qvt.oml/src/org/eclipse/m2m/internal/qvt/oml/ast/parser/QvtOperationalVisitorCS.java >@@ -9,7 +9,7 @@ > * Borland Software Corporation - initial API and implementation > * Christopher Gerking - bugs 302594, 310991 > * Alex Paperno - bugs 272869, 268636, 404647, 414363, 414363, 401521, >- * 419299 >+ * 419299, 403440 > *******************************************************************************/ > package org.eclipse.m2m.internal.qvt.oml.ast.parser; > >@@ -3725,8 +3725,8 @@ > /** > * TODO - make a common resolution operation, reusable in for ResolveInExp too. > */ >- private List<EOperation> resolveMappingOperationReference(ScopedNameCS identifierCS, QvtOperationalEnv env) { >- List<EOperation> result = Collections.emptyList(); >+ private List<MappingOperation> resolveMappingOperationReference(ScopedNameCS identifierCS, QvtOperationalEnv env) { >+ List<MappingOperation> result = Collections.emptyList(); > > TypeCS typeCS = identifierCS.getTypeCS(); > EClassifier owningType = null; >@@ -3742,8 +3742,8 @@ > } > // filter out inherited mappings > if(!result.isEmpty()) { >- List<EOperation> ownerLocalOpers = new ArrayList<EOperation>(result.size()); >- for (EOperation operation : result) { >+ List<MappingOperation> ownerLocalOpers = new ArrayList<MappingOperation>(result.size()); >+ for (MappingOperation operation : result) { > EClassifier owner = env.getUMLReflection().getOwningClassifier(operation); > if ((typeCS == null && owner == null) || (TypeUtil.resolveType(env, owner) == owningType)) { > ownerLocalOpers.add(operation); >@@ -3774,10 +3774,10 @@ > MappingExtensionKindCS kind = extensionCS.getKind(); > > for (ScopedNameCS identifierCS : extensionCS.getMappingIdentifiers()) { >- List<EOperation> mappings = resolveMappingOperationReference(identifierCS, env); >+ List<MappingOperation> mappings = resolveMappingOperationReference(identifierCS, env); > if(mappings.size() == 1) { > boolean isAdded = false; >- MappingOperation extendedMapping = (MappingOperation)mappings.get(0); >+ MappingOperation extendedMapping = mappings.get(0); > if(kind == MappingExtensionKindCS.INHERITS) { > isAdded = operation.getInherited().add(extendedMapping); > MappingExtensionHelper.bind2SourceElement(operation, identifierCS, kind); >@@ -4564,14 +4564,21 @@ > EClassifier eClassifier = (contextTypeCS == null) ? null : visitTypeCS(contextTypeCS, null, env); // mapping context type > eClassifier = eClassifier != null ? eClassifier : env.getModuleContextType(); > String mappingName = resolveInExpCS.getInMappingName().getValue(); >- List<EOperation> rawMappingOperations = env.lookupMappingOperations(eClassifier, mappingName); >- List<EOperation> mappingOperations = new ArrayList<EOperation>(); >+ List<MappingOperation> rawMappingOperations = env.lookupMappingOperations(eClassifier, mappingName); >+ List<MappingOperation> unfilteredMappingOperations = new ArrayList<MappingOperation>(); >+ List<MappingOperation> mappingOperations = new ArrayList<MappingOperation>(); > >- for (EOperation operation : rawMappingOperations) { >+ for (MappingOperation operation : rawMappingOperations) { > EClassifier owner = env.getUMLReflection().getOwningClassifier(operation); > if (((contextTypeCS == null) && (owner == null)) > || (TypeUtil.resolveType(env, owner) == eClassifier)) { >- mappingOperations.add(operation); >+ unfilteredMappingOperations.add(operation); >+ } >+ } >+ mappingOperations.addAll(unfilteredMappingOperations); >+ for (MappingOperation operation : unfilteredMappingOperations) { >+ if (unfilteredMappingOperations.contains(operation.getOverridden())) { >+ mappingOperations.remove(operation.getOverridden()); > } > } > if (mappingOperations.size() == 1) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
serg.boyko2011
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 403440
: 237662 |
237663