diff options
5 files changed, 41 insertions, 41 deletions
diff --git a/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/evaluator/QVTiVMExecutor.java b/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/evaluator/QVTiVMExecutor.java index bcabcb830..5560567c7 100644 --- a/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/evaluator/QVTiVMExecutor.java +++ b/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/evaluator/QVTiVMExecutor.java @@ -19,7 +19,7 @@ import org.eclipse.ocl.examples.debug.vm.evaluator.IVMContext; import org.eclipse.ocl.examples.debug.vm.evaluator.VMEvaluationStepper; import org.eclipse.ocl.examples.debug.vm.evaluator.VMExecutor; import org.eclipse.ocl.pivot.NamedElement; -import org.eclipse.ocl.pivot.OCLExpression; +import org.eclipse.ocl.pivot.TypedElement; import org.eclipse.ocl.pivot.evaluation.EvaluationEnvironment; import org.eclipse.qvtd.debug.QVTiDebugPlugin; import org.eclipse.qvtd.pivot.qvtbase.Transformation; @@ -34,10 +34,10 @@ public class QVTiVMExecutor extends BasicQVTiExecutor implements VMExecutor private boolean suspendOnStartup = false; private long envId = 0; - public QVTiVMExecutor(@NonNull IVMContext vmContext, @NonNull URI transformationURI) throws IOException { - super((QVTiEnvironmentFactory)vmContext.getEnvironmentFactory(), QVTimperativeUtil.loadTransformation((QVTiEnvironmentFactory)vmContext.getEnvironmentFactory(), transformationURI, vmContext.keepDebug())); + public QVTiVMExecutor(@NonNull IVMContext vmContext, @NonNull URI transformationURI) throws IOException { + super((QVTiEnvironmentFactory)vmContext.getEnvironmentFactory(), QVTimperativeUtil.loadTransformation((QVTiEnvironmentFactory)vmContext.getEnvironmentFactory(), transformationURI, vmContext.keepDebug())); this.vmContext = vmContext; - } + } @Override protected @NonNull QVTiVMEvaluationVisitor createEvaluationVisitor() { @@ -47,8 +47,8 @@ public class QVTiVMExecutor extends BasicQVTiExecutor implements VMExecutor } @Override - protected @NonNull QVTiVMEvaluationEnvironment createNestedEvaluationEnvironment(EvaluationEnvironment.@NonNull EvaluationEnvironmentExtension evaluationEnvironment, @NonNull NamedElement executableObject, @Nullable OCLExpression callingObject) { - return new QVTiVMNestedEvaluationEnvironment((QVTiVMEvaluationEnvironment) evaluationEnvironment, executableObject, callingObject, ++envId); + protected @NonNull QVTiVMEvaluationEnvironment createNestedEvaluationEnvironment(EvaluationEnvironment.@NonNull EvaluationEnvironmentExtension evaluationEnvironment, @NonNull NamedElement executableObject, @Nullable TypedElement caller) { + return new QVTiVMNestedEvaluationEnvironment((QVTiVMEvaluationEnvironment) evaluationEnvironment, executableObject, caller, ++envId); } @Override diff --git a/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/evaluator/QVTiVMNestedEvaluationEnvironment.java b/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/evaluator/QVTiVMNestedEvaluationEnvironment.java index fe87c037e..76de2ef84 100644 --- a/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/evaluator/QVTiVMNestedEvaluationEnvironment.java +++ b/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/evaluator/QVTiVMNestedEvaluationEnvironment.java @@ -24,7 +24,7 @@ import org.eclipse.ocl.examples.debug.vm.utils.VMRuntimeException; import org.eclipse.ocl.examples.debug.vm.utils.VMStackTraceBuilder; import org.eclipse.ocl.pivot.Element; import org.eclipse.ocl.pivot.NamedElement; -import org.eclipse.ocl.pivot.OCLExpression; +import org.eclipse.ocl.pivot.TypedElement; import org.eclipse.ocl.pivot.Variable; import org.eclipse.qvtd.debug.vm.QVTiVariableFinder; import org.eclipse.qvtd.pivot.qvtbase.Transformation; @@ -34,12 +34,12 @@ public class QVTiVMNestedEvaluationEnvironment extends QVTiNestedEvaluationEnvir { private @NonNull Element myCurrentIP; private @NonNull NamedElement myOperation; // Redundant if final - private final int myStackDepth; + private final int myStackDepth; private final long id; private final @NonNull Stack<StepperEntry> stepperStack = new Stack<StepperEntry>(); - - public QVTiVMNestedEvaluationEnvironment(@NonNull QVTiVMEvaluationEnvironment evaluationEnvironment, @NonNull NamedElement executableObject, @Nullable OCLExpression callingObject, long id) { - super(evaluationEnvironment, executableObject, callingObject); + + public QVTiVMNestedEvaluationEnvironment(@NonNull QVTiVMEvaluationEnvironment evaluationEnvironment, @NonNull NamedElement executableObject, @Nullable TypedElement caller, long id) { + super(evaluationEnvironment, executableObject, caller); myStackDepth = evaluationEnvironment.getDepth() + 1; this.id = id; this.myOperation = executableObject; @@ -50,7 +50,7 @@ public class QVTiVMNestedEvaluationEnvironment extends QVTiNestedEvaluationEnvir public @NonNull QVTiVMEvaluationEnvironment createClonedEvaluationEnvironment() { throw new UnsupportedOperationException(); } - + @Override public @NonNull VariableFinder createVariableFinder(boolean isStoreValues) { return new QVTiVariableFinder(this, isStoreValues); @@ -63,14 +63,14 @@ public class QVTiVMNestedEvaluationEnvironment extends QVTiNestedEvaluationEnvir @Override public @NonNull UnitLocation getCurrentLocation() { -// if (myCurrentIP == null) { -// return null; -// } -// else { + // if (myCurrentIP == null) { + // return null; + // } + // else { int startPosition = ASTBindingHelper.getStartPosition(myCurrentIP); int endPosition = ASTBindingHelper.getEndPosition(myCurrentIP); - return new UnitLocation(startPosition, endPosition, this, myCurrentIP); -// } + return new UnitLocation(startPosition, endPosition, this, myCurrentIP); + // } } @Override @@ -88,10 +88,10 @@ public class QVTiVMNestedEvaluationEnvironment extends QVTiNestedEvaluationEnvir return myStackDepth; } -// @Override -// public QvtRuntimeException getException() { -// return rootEvaluationEnvironment.getException(); -// } + // @Override + // public QvtRuntimeException getException() { + // return rootEvaluationEnvironment.getException(); + // } @Override public long getID() { @@ -127,11 +127,11 @@ public class QVTiVMNestedEvaluationEnvironment extends QVTiNestedEvaluationEnvir public boolean isDeferredExecution() { return getVMRootEvaluationEnvironment().isDeferredExecution(); } - - @Override + + @Override public void processDeferredTasks() { - getVMRootEvaluationEnvironment().processDeferredTasks(); - } + getVMRootEvaluationEnvironment().processDeferredTasks(); + } @Override public @NonNull Element setCurrentIP(@NonNull Element element) { @@ -153,7 +153,7 @@ public class QVTiVMNestedEvaluationEnvironment extends QVTiNestedEvaluationEnvir } catch (Exception e) { getDebugCore().error("Failed to build QVT stack trace", e); //$NON-NLS-1$ } - + throw exception; } } diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/BasicQVTiExecutor.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/BasicQVTiExecutor.java index 15530931a..984fc8d2d 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/BasicQVTiExecutor.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/BasicQVTiExecutor.java @@ -114,12 +114,12 @@ public class BasicQVTiExecutor extends AbstractExecutor implements QVTiExecutor } @Override - protected EvaluationEnvironment.@NonNull EvaluationEnvironmentExtension createNestedEvaluationEnvironment(EvaluationEnvironment.@NonNull EvaluationEnvironmentExtension evaluationEnvironment, @NonNull NamedElement executableObject, @Nullable OCLExpression callingObject) { + protected EvaluationEnvironment.@NonNull EvaluationEnvironmentExtension createNestedEvaluationEnvironment(EvaluationEnvironment.@NonNull EvaluationEnvironmentExtension evaluationEnvironment, @NonNull NamedElement executableObject, @Nullable TypedElement caller) { if (evaluationEnvironment instanceof QVTiEvaluationEnvironment) { - return new QVTiNestedEvaluationEnvironment((QVTiEvaluationEnvironment) evaluationEnvironment, executableObject, callingObject); + return new QVTiNestedEvaluationEnvironment((QVTiEvaluationEnvironment) evaluationEnvironment, executableObject, caller); } else{ - return super.createNestedEvaluationEnvironment(evaluationEnvironment, executableObject, callingObject); + return super.createNestedEvaluationEnvironment(evaluationEnvironment, executableObject, caller); } } @@ -371,7 +371,7 @@ public class BasicQVTiExecutor extends AbstractExecutor implements QVTiExecutor protected @Nullable Object internalExecuteFunctionCallExp(@NonNull OperationCallExp operationCallExp, @NonNull Function referredFunction, @Nullable Object @NonNull [] boxedSourceAndArgumentValues) { // PivotUtil.checkExpression(expressionInOCL); - EvaluationEnvironment nestedEvaluationEnvironment = pushEvaluationEnvironment(referredFunction, operationCallExp); + EvaluationEnvironment nestedEvaluationEnvironment = pushEvaluationEnvironment(referredFunction, (TypedElement)operationCallExp); // nestedEvaluationEnvironment.add(ClassUtil.nonNullModel(expressionInOCL.getOwnedContext()), sourceValue); List<Parameter> parameters = referredFunction.getOwnedParameters(); if (!parameters.isEmpty()) { @@ -404,7 +404,7 @@ public class BasicQVTiExecutor extends AbstractExecutor implements QVTiExecutor public @Nullable Object internalExecuteMappingCall(@NonNull MappingCall mappingCall, @NonNull Object @NonNull [] boundValues, @NonNull EvaluationVisitor undecoratedVisitor) { Mapping calledMapping = mappingCall.getReferredMapping(); if (calledMapping != null) { - pushEvaluationEnvironment(calledMapping, mappingCall); + pushEvaluationEnvironment(calledMapping, (TypedElement)mappingCall); try { int index = 0; for (MappingCallBinding binding : mappingCall.getBinding()) { @@ -504,7 +504,7 @@ public class BasicQVTiExecutor extends AbstractExecutor implements QVTiExecutor throw new IllegalStateException("Transformation " + transformation.getName() + " has no root mapping"); } CallExp callExp = PivotFactory.eINSTANCE.createOperationCallExp(); // FIXME TransformationCallExp - pushEvaluationEnvironment(rule, callExp); + pushEvaluationEnvironment(rule, (TypedElement)callExp); try { rule.accept(undecoratedVisitor); } diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiIncrementalExecutor.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiIncrementalExecutor.java index a5dee85a4..2b791c206 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiIncrementalExecutor.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiIncrementalExecutor.java @@ -125,7 +125,7 @@ public class QVTiIncrementalExecutor extends BasicQVTiExecutor return false; } for (int i = 0; i < iMax; i++) { - if (!ClassUtil.safeEquals(theseValues[i], thoseValues[i])) { + if (!idResolver.oclEquals(theseValues[i], thoseValues[i])) { return false; } } @@ -187,7 +187,7 @@ public class QVTiIncrementalExecutor extends BasicQVTiExecutor return false; } for (int i = 0; i < iMax; i++) { - if (!ClassUtil.safeEquals(theseValues[i], thoseValues[i])) { + if (!idResolver.oclEquals(theseValues[i], thoseValues[i])) { return false; } } diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiNestedEvaluationEnvironment.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiNestedEvaluationEnvironment.java index 0946ba5c4..94cc90c9a 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiNestedEvaluationEnvironment.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiNestedEvaluationEnvironment.java @@ -14,9 +14,9 @@ import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.ocl.pivot.Element; import org.eclipse.ocl.pivot.NamedElement; -import org.eclipse.ocl.pivot.OCLExpression; import org.eclipse.ocl.pivot.Operation; import org.eclipse.ocl.pivot.OperationCallExp; +import org.eclipse.ocl.pivot.TypedElement; import org.eclipse.ocl.pivot.evaluation.EvaluationEnvironment; import org.eclipse.ocl.pivot.internal.evaluation.BasicEvaluationEnvironment; import org.eclipse.qvtd.pivot.qvtbase.Transformation; @@ -27,9 +27,9 @@ public class QVTiNestedEvaluationEnvironment extends BasicEvaluationEnvironment { protected final @NonNull QVTiRootEvaluationEnvironment rootEvaluationEnvironment; private @Nullable DomainUsageAnalysis usageAnalysis; - - public QVTiNestedEvaluationEnvironment(@NonNull QVTiEvaluationEnvironment evaluationEnvironment, @NonNull NamedElement executableObject, @Nullable OCLExpression callingObject) { - super(evaluationEnvironment, executableObject, callingObject); + + public QVTiNestedEvaluationEnvironment(@NonNull QVTiEvaluationEnvironment evaluationEnvironment, @NonNull NamedElement executableObject, @Nullable TypedElement caller) { + super(evaluationEnvironment, executableObject, caller); rootEvaluationEnvironment = evaluationEnvironment.getRootEvaluationEnvironment(); } @@ -60,8 +60,8 @@ public class QVTiNestedEvaluationEnvironment extends BasicEvaluationEnvironment DomainUsage domainUsage = null; DomainUsageAnalysis usageAnalysis2 = usageAnalysis; if (usageAnalysis2 == null) { - if (callingObject instanceof OperationCallExp) { - OperationCallExp operationCallExp = (OperationCallExp)callingObject; + if (caller instanceof OperationCallExp) { + OperationCallExp operationCallExp = (OperationCallExp)caller; Operation referredOperation = operationCallExp.getReferredOperation(); if (referredOperation != null) { usageAnalysis = usageAnalysis2 = getExecutor().getModelManager().getTransformationAnalysis().getDomainUsageAnalysis().getAnalysis(referredOperation); |