Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2013-11-30 23:09:51 +0000
committerAnsgar Radermacher2013-11-30 23:19:47 +0000
commit83937dde13ef67c8e7d740c06da4e1950e2826b9 (patch)
treed06a69156b52fd2ee88f0f46f59d381d86777ae2 /extraplugins
parentd6b64632c6706fe8163202bb89352c6c703c1f56 (diff)
downloadorg.eclipse.papyrus-83937dde13ef67c8e7d740c06da4e1950e2826b9.tar.gz
org.eclipse.papyrus-83937dde13ef67c8e7d740c06da4e1950e2826b9.tar.xz
org.eclipse.papyrus-83937dde13ef67c8e7d740c06da4e1950e2826b9.zip
- 422899 - [QDesigner] Regression in template instantiation
Diffstat (limited to 'extraplugins')
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CommandSupport.java7
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/AllocUtils.java1
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/BootLoaderGen.java3
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateInstantiation.java2
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/ContainerTrafo.java4
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/Copy.java22
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/UpdateUtils.java7
7 files changed, 29 insertions, 17 deletions
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CommandSupport.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CommandSupport.java
index 21a80bced95..261e56f3a43 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CommandSupport.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CommandSupport.java
@@ -100,18 +100,17 @@ public class CommandSupport {
}
}, null, null);
} catch (ExecutionException e) {
- e.printStackTrace();
+ Activator.log.error(e);
}
}
}
- public static void exec(TransactionalEditingDomain domain, IUndoableOperation command) {
+ public static void exec(IUndoableOperation command) {
IOperationHistory history = OperationHistoryFactory.getOperationHistory();
try {
history.execute(command, new NullProgressMonitor(), null);
} catch (ExecutionException e) {
- e.printStackTrace();
+ Activator.log.error(e);
}
-
}
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/AllocUtils.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/AllocUtils.java
index db6d6745aea..8d92db8ab03 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/AllocUtils.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/AllocUtils.java
@@ -259,6 +259,7 @@ public class AllocUtils {
" to " + node.getName(), UMLPackage.eINSTANCE.getAbstraction()); //$NON-NLS-1$
if(StereotypeUtil.apply(allocation, Allocate.class) == null) {
// stereotype application failed
+ allocation.destroy();
return false;
}
allocation.getClients().add(instance);
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/BootLoaderGen.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/BootLoaderGen.java
index c5ca6e027b5..2f08cce0bd6 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/BootLoaderGen.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/BootLoaderGen.java
@@ -110,6 +110,9 @@ public class BootLoaderGen {
* }
*/
Include cppInclude = StereotypeUtil.applyApp(m_bootLoader, Include.class);
+ if (cppInclude == null) {
+ throw new TransformationException("Cannot apply cppInclude stereotype. Make sure that C/C++ profile is applied to your model");
+ }
Object existingBody = cppInclude.getBody();
String existingBodyStr = ""; //$NON-NLS-1$
if(existingBody instanceof String) {
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateInstantiation.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateInstantiation.java
index f0fc9e75a25..36ee99a3941 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateInstantiation.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateInstantiation.java
@@ -106,7 +106,7 @@ public class TemplateInstantiation {
for(TemplateParameterSubstitution substitution : binding.getParameterSubstitutions()) {
ParameterableElement formal = substitution.getFormal().getParameteredElement();
ParameterableElement actual = substitution.getActual();
- copy.put(formal, actual);
+ copy.putPair(formal, actual);
}
// add copy listeners ---
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/ContainerTrafo.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/ContainerTrafo.java
index 2009d421e6e..7626b23535c 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/ContainerTrafo.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/ContainerTrafo.java
@@ -286,7 +286,7 @@ public class ContainerTrafo extends AbstractContainerTrafo {
expandAggregationExtension(part.getName(), extOrInterceptor, tmComponent);
// register relation to facilitate connector copy
copy.setPackageTemplate(smContainerRule.getBase_Class(), tmContainerImpl);
- copy.put(part, extensionPart);
+ copy.putPair(part, extensionPart);
copy.setPackageTemplate(null, null);
}
}
@@ -315,7 +315,7 @@ public class ContainerTrafo extends AbstractContainerTrafo {
for(Property interceptorPart : interceptorPartsMap.get(ruleInterceptorPart)) {
// map an interceptor part within rule successively to to an interceptor part
// within the container
- copy.put(ruleInterceptorPart, interceptorPart);
+ copy.putPair(ruleInterceptorPart, interceptorPart);
copy.removeForCopy(connector);
copy.getCopy(connector);
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/Copy.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/Copy.java
index 3829bb540c4..8c571972136 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/Copy.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/Copy.java
@@ -212,6 +212,19 @@ public class Copy extends Copier {
return null;
}
+ /**
+ * Put a pair into the copy map. Unlike the standard put operation,
+ * the target object is marked as full copy.
+ * Just using the put operation lead to bug 422899 - [QDesigner] Regression in
+ * template instantiation
+ * @return
+ */
+ public EObject putPair(EObject sourceEObj, EObject targetEObj) {
+ EObject target = put(sourceEObj, targetEObj);
+ setStatus(targetEObj, CopyStatus.FULL);
+ return target;
+ }
+
@Override
public boolean containsKey(Object sourceEObj) {
if(sourceEObj instanceof EObject) {
@@ -246,11 +259,6 @@ public class Copy extends Copier {
* @return
*/
public CopyStatus getStatus(EObject targetEObj) {
- /*
- if (targetEObj instanceof Package) {
- return true;
- }
- */
if (targetEObj != null) {
CopyStatus status = statusMap.get(targetEObj);
if(status != null) {
@@ -260,10 +268,6 @@ public class Copy extends Copier {
return CopyStatus.UNKNOWN;
}
- // public Namespace getPackageTemplate() {
- // return null;
- // }
-
/**
* Set the reference of a bound package template. It must be a member of the target model.
* Setting the package template is required to assure that elements that are part of a different
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/UpdateUtils.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/UpdateUtils.java
index 259bb029206..88a590a6082 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/UpdateUtils.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/UpdateUtils.java
@@ -63,7 +63,12 @@ public class UpdateUtils {
public static void setSource(Element derivedElement, Element source) {
DerivedElement de = StereotypeUtil.applyApp(derivedElement, DerivedElement.class);
- de.setSource(source);
+ if (de != null) {
+ de.setSource(source);
+ }
+ else {
+ throw new TransformationRTException("cannot apply FCM stereotype. Check whether profile is applied");
+ }
}
public static Element getSource(Element element) {

Back to the top