Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2015-02-27 07:38:24 +0000
committerEd Willink2015-02-27 08:06:33 +0000
commit9da0f8e2dea6bc7ded79fa0be331da6bcf96720a (patch)
tree561764f9e872d48d0fbd1ce6f66cb474952a8f20
parent205bd4c28ed892d0e7cf66e5acebf49de57ad290 (diff)
downloadorg.eclipse.qvtd-9da0f8e2dea6bc7ded79fa0be331da6bcf96720a.tar.gz
org.eclipse.qvtd-9da0f8e2dea6bc7ded79fa0be331da6bcf96720a.tar.xz
org.eclipse.qvtd-9da0f8e2dea6bc7ded79fa0be331da6bcf96720a.zip
[460682] Exception during ProperyAssignment propagates
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiAbstractEvaluationVisitor.java43
1 files changed, 18 insertions, 25 deletions
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiAbstractEvaluationVisitor.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiAbstractEvaluationVisitor.java
index 070ba8258..2f3cb06ac 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiAbstractEvaluationVisitor.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiAbstractEvaluationVisitor.java
@@ -88,33 +88,26 @@ public abstract class QVTiAbstractEvaluationVisitor extends OCLEvaluationVisitor
}
protected void doPropertyAssignment(@NonNull PropertyAssignment propertyAssignment, @Nullable Integer cacheIndex) {
- try {
- Object slotExpValue = safeVisit(propertyAssignment.getSlotExpression());
- if (slotExpValue instanceof EObject) {
- Object boxedValue = safeVisit(propertyAssignment.getValue());
- Property targetProperty = propertyAssignment.getTargetProperty();
- Class<?> instanceClass = null;
- EObject eTarget = targetProperty.getESObject();
- if (eTarget instanceof EStructuralFeature) {
- EClassifier eType = ((EStructuralFeature)eTarget).getEType();
- if (eType != null) {
- instanceClass = eType.getInstanceClass();
- }
+ Object slotExpValue = safeVisit(propertyAssignment.getSlotExpression());
+ if (slotExpValue instanceof EObject) {
+ Object boxedValue = safeVisit(propertyAssignment.getValue());
+ Property targetProperty = propertyAssignment.getTargetProperty();
+ Class<?> instanceClass = null;
+ EObject eTarget = targetProperty.getESObject();
+ if (eTarget instanceof EStructuralFeature) {
+ EClassifier eType = ((EStructuralFeature)eTarget).getEType();
+ if (eType != null) {
+ instanceClass = eType.getInstanceClass();
}
- Object ecoreValue = environmentFactory.getIdResolver().ecoreValueOf(instanceClass, boxedValue);
- targetProperty.initValue((EObject) slotExpValue, ecoreValue);
- if (cacheIndex != null) {
- getModelManager().setMiddleOpposite(cacheIndex, slotExpValue, ecoreValue);
- }
- } else {
- throw new IllegalArgumentException("Unsupported " + propertyAssignment.eClass().getName()
- + " specification. The assigment slot expression evaluates to non-ecore value");
}
- } catch (InvalidValueException ex) {
- // There was an OCLVoid value being navigated or any other/similar OCL error
- // evaluating the slot or value expression
- // TODO, is this an error?
- System.out.println("visitPropertyAssignment InvalidValueException");
+ Object ecoreValue = environmentFactory.getIdResolver().ecoreValueOf(instanceClass, boxedValue);
+ targetProperty.initValue((EObject) slotExpValue, ecoreValue);
+ if (cacheIndex != null) {
+ getModelManager().setMiddleOpposite(cacheIndex, slotExpValue, ecoreValue);
+ }
+ } else {
+ throw new IllegalArgumentException("Unsupported " + propertyAssignment.eClass().getName()
+ + " specification. The assigment slot expression evaluates to non-ecore value");
}
}

Back to the top