From 76b16f298e6e6d99e4fda17ba9b38bb181792ecc Mon Sep 17 00:00:00 2001 From: Johannes Mey <johannes.mey@tu-dresden.de> Date: Sat, 4 Jan 2020 13:30:00 +0100 Subject: [PATCH] fix printing of null-valued (i.e., optional or empty list) relations --- scope4m/src/main/jastadd/ASTPrinting.jadd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scope4m/src/main/jastadd/ASTPrinting.jadd b/scope4m/src/main/jastadd/ASTPrinting.jadd index ce00afc..67099c0 100644 --- a/scope4m/src/main/jastadd/ASTPrinting.jadd +++ b/scope4m/src/main/jastadd/ASTPrinting.jadd @@ -14,7 +14,8 @@ aspect Debugging { } else { name += ":= "; } - result += "|--" + name + method.invoke(this).toString().split("\\r?\\n")[0]; + Object value = method.invoke(this); + result += "|--" + name + (value == null ? "<null>" : value.toString().split("\\r?\\n")[0]); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (java.lang.reflect.InvocationTargetException e) { -- GitLab