From 490854995c3240790111a428cfdd8b3ea5d47d18 Mon Sep 17 00:00:00 2001 From: Sarah Grebing Date: Sat, 7 Jul 2018 19:40:36 +0200 Subject: [PATCH] Bugfix for handling post mortem states --- .../kit/iti/formal/psdbg/parser/ast/Statements.java | 4 +++- .../iti/formal/psdbg/gui/controller/DebuggerMain.java | 11 ++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lang/src/main/java/edu/kit/iti/formal/psdbg/parser/ast/Statements.java b/lang/src/main/java/edu/kit/iti/formal/psdbg/parser/ast/Statements.java index 8048e4c3..a2c4f4aa 100644 --- a/lang/src/main/java/edu/kit/iti/formal/psdbg/parser/ast/Statements.java +++ b/lang/src/main/java/edu/kit/iti/formal/psdbg/parser/ast/Statements.java @@ -47,7 +47,9 @@ public class Statements extends ASTNode @Override public ASTNode[] getChildren() { - return (ASTNode[]) toArray(); + Object[] arr = toArray(); + return toArray(new ASTNode[arr.length]); + //return (ASTNode[]) toArray(); } public Statements(Statements body) { diff --git a/ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controller/DebuggerMain.java b/ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controller/DebuggerMain.java index 73c70399..619d3356 100644 --- a/ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controller/DebuggerMain.java +++ b/ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controller/DebuggerMain.java @@ -189,7 +189,7 @@ public class DebuggerMain implements Initializable { .filter(it -> Objects.equals(fna.childOrMe(it.getStatement()), it.getStatement())) .collect(Collectors.toList()); - System.out.println(result); + LOGGER.info(result); for (PTreeNode statePointerToPostMortem : result) { @@ -213,13 +213,18 @@ public class DebuggerMain implements Initializable { if (stateAfterStmt.getSelectedGoalNode() != null) { im.setSelectedGoalNodeToShow(stateAfterStmt.getSelectedGoalNode()); } else { - im.setSelectedGoalNodeToShow(goals.get(0)); + if(goals.size() > 0) { + im.setSelectedGoalNodeToShow(goals.get(0)); + } else { + im.setSelectedGoalNodeToShow(stateBeforeStmt.getSelectedGoalNode()); + statusBar.publishMessage("This goal node was closed by the selected mutator."); + } } inspectionViewsController.newPostMortemInspector(im) .dock(dockStation, DockPos.CENTER, getActiveInspectorDock()); } else { - statusBar.publishErrorMessage("There is no post mortem state to show to this node, because this node was not executed."); + statusBar.publishErrorMessage("There is no post mortem state to show to this node, because this node was not executed or is a selector statement."); } } } -- GitLab