Commit cbd58a54 authored by Sarah Grebing's avatar Sarah Grebing

Fix for NPE and labels

parent ee046b3b
Pipeline #17740 failed with stages
...@@ -102,7 +102,7 @@ public class KeYMatcher implements MatcherApi<KeyData> { ...@@ -102,7 +102,7 @@ public class KeYMatcher implements MatcherApi<KeyData> {
* Match the label of a goal node * Match the label of a goal node
* *
* @param currentState goal node as possible match cancidate * @param currentState goal node as possible match cancidate
* @param label String representation for regualr expression for label to match * @param label String representation for regular expression for label to match
* @return List of matches if match was sucessful, empty list otherwise * @return List of matches if match was sucessful, empty list otherwise
*/ */
@Override @Override
...@@ -111,10 +111,14 @@ public class KeYMatcher implements MatcherApi<KeyData> { ...@@ -111,10 +111,14 @@ public class KeYMatcher implements MatcherApi<KeyData> {
List<VariableAssignment> assignments = new ArrayList<>(); List<VariableAssignment> assignments = new ArrayList<>();
resultsFromLabelMatch = new ArrayList<>(); resultsFromLabelMatch = new ArrayList<>();
//compile pattern //compile pattern
Pattern regexpForLabel = Pattern.compile(label); String cleanLabel = label.replaceAll(" ", "");
Pattern regexpForLabel = Pattern.compile(cleanLabel);
String branchLabel = currentState.getData().getBranchingLabel(); String branchLabel = currentState.getData().getBranchingLabel();
Matcher branchLabelMatcher = regexpForLabel.matcher(branchLabel); String cleanBranchLabel = branchLabel.replaceAll(" ", "");
Matcher branchLabelMatcher = regexpForLabel.matcher(cleanBranchLabel);
if (branchLabelMatcher.matches()) { if (branchLabelMatcher.matches()) {
......
...@@ -447,8 +447,9 @@ public class DebuggerMain implements Initializable { ...@@ -447,8 +447,9 @@ public class DebuggerMain implements Initializable {
} }
//model.reload(); //model.reload();
abortExecution(); abortExecution();
Platform.runLater(() -> model.setStatePointer(null));
handleStatePointerUI(null); handleStatePointerUI(null);
model.setStatePointer(null);
//reload getInspectionViewsController().getActiveInspectionViewTab().getModel() //reload getInspectionViewsController().getActiveInspectionViewTab().getModel()
InspectionModel iModel = getInspectionViewsController().getActiveInspectionViewTab().getModel(); InspectionModel iModel = getInspectionViewsController().getActiveInspectionViewTab().getModel();
//iModel.setHighlightedJavaLines(FXCollections.emptyObservableSet()); //iModel.setHighlightedJavaLines(FXCollections.emptyObservableSet());
......
...@@ -66,7 +66,7 @@ public class BaseCodeArea extends CodeArea { ...@@ -66,7 +66,7 @@ public class BaseCodeArea extends CodeArea {
final int start = lm.getLineStart(line); final int start = lm.getLineStart(line);
final int end = lm.getLineEnd(line); final int end = lm.getLineEnd(line);
setStyle(start, end, Collections.singleton(clazz)); setStyle(start, end, Collections.singleton(clazz));
} catch (ArrayIndexOutOfBoundsException e) { } catch (IndexOutOfBoundsException e) {
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment