Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Wagelaar2018-09-18 04:30:26 -0400
committerDennis Wagelaar2018-09-18 04:30:26 -0400
commit4f71541bbf48342f4dfbeefec674a7a7b3e0520b (patch)
tree9070dc333e8b3d2704a483fdc521286a2514b69e /plugins
parentd52f9cad02db1f61c331df537e988d374c972a1e (diff)
downloadorg.eclipse.atl-4f71541bbf48342f4dfbeefec674a7a7b3e0520b.tar.gz
org.eclipse.atl-4f71541bbf48342f4dfbeefec674a7a7b3e0520b.tar.xz
org.eclipse.atl-4f71541bbf48342f4dfbeefec674a7a7b3e0520b.zip
535793: NullPointerException in EMFTVMUtil#checkValueTypeIsEObject()
Change-Id: I9c1d18959bb03a48a72c2e8029522065c1cb76c1 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=535793 Signed-off-by: Dennis Wagelaar <dwagelaar@gmail.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/EMFTVMUtil.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/EMFTVMUtil.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/EMFTVMUtil.java
index 9bcd51a0..cfdbb110 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/EMFTVMUtil.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/EMFTVMUtil.java
@@ -878,9 +878,12 @@ public final class EMFTVMUtil {
*/
private static void checkValueTypeIsEObject(final ExecEnv env, final EReference ref, final Object v) {
if (!(v instanceof EObject)) {
- throw new IllegalArgumentException(String.format(
- "Cannot add/remove values of type %s to/from multi-valued field %s::%s",
- getTypeName(env, v.getClass()), ref.getEContainingClass().getName(), ref.getName()));
+ final String message = v == null
+ ? String.format("Cannot add/remove OclUndefined to/from multi-valued field %s::%s",
+ ref.getEContainingClass().getName(), ref.getName())
+ : String.format("Cannot add/remove values of type %s to/from multi-valued field %s::%s",
+ getTypeName(env, v.getClass()), ref.getEContainingClass().getName(), ref.getName());
+ throw new IllegalArgumentException(message);
}
}
@@ -999,7 +1002,7 @@ public final class EMFTVMUtil {
private static void addRefValue(final ExecEnv env, final EReference ref, final EObject eo, final Collection<Object> values,
final EObject v, final int index, final boolean allowInterModelReferences) {
assert eo.eResource() != null;
- assert v.eResource() != null;
+ assert v == null || v.eResource() != null;
if (checkValue(env, eo, ref, v, allowInterModelReferences)) {
if (index > -1) {
((List<Object>) values).add(index, v);

Back to the top