Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Charles David2016-02-26 14:51:15 +0000
committerPierre-Charles David2016-02-29 14:38:28 +0000
commit50b37c16ac4aff0a41776d1d5b0dd1501860e097 (patch)
treed707b7f3d99060aac78d4fefb4149fc7b721caad
parent3df4c866ee8549497009acb5984d5d178aee9db7 (diff)
downloadorg.eclipse.sirius-50b37c16ac4aff0a41776d1d5b0dd1501860e097.tar.gz
org.eclipse.sirius-50b37c16ac4aff0a41776d1d5b0dd1501860e097.tar.xz
org.eclipse.sirius-50b37c16ac4aff0a41776d1d5b0dd1501860e097.zip
[482528] Consider null as a valid evaluation result
It is perfectly legitimate for an expression to return null, but we considered this as a failure which disabled a lot of behavior which depends on IEvaluationResult.success(). Note that AQL raises a WARNING in its own EvaluationResult class when a *service* returns null (instead of Nothing). It is debatable if this is a good idea (see #487006), but for now this means we have to consider diagnostics with a WARNING severity to represent successful evaluations. Bug: 482528 Change-Id: Id7be86b5c330fd4e1d5dee5948f32a4aae32dd70 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
-rw-r--r--incubation/org.eclipse.sirius.common.interpreter/src/org/eclipse/sirius/common/interpreter/api/EvaluationResult.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/incubation/org.eclipse.sirius.common.interpreter/src/org/eclipse/sirius/common/interpreter/api/EvaluationResult.java b/incubation/org.eclipse.sirius.common.interpreter/src/org/eclipse/sirius/common/interpreter/api/EvaluationResult.java
index 8b59e38bbf..c194cfbfc2 100644
--- a/incubation/org.eclipse.sirius.common.interpreter/src/org/eclipse/sirius/common/interpreter/api/EvaluationResult.java
+++ b/incubation/org.eclipse.sirius.common.interpreter/src/org/eclipse/sirius/common/interpreter/api/EvaluationResult.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 Obeo.
+ * Copyright (c) 2015, 2016 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -74,7 +74,7 @@ public class EvaluationResult implements IEvaluationResult {
@Override
public boolean success() {
- return Diagnostic.OK == status.getSeverity() && rawValue != null;
+ return Diagnostic.ERROR != status.getSeverity();
}
@Override

Back to the top