Skip to content

Commit

Permalink
Incorrect hyperltl trace - fix 2051165 (#131)
Browse files Browse the repository at this point in the history
Fixes:
https://bugs.launchpad.net/tapaal/+bug/2051165

This is only a partial fix, it should be fixed also in the engine so that the trace-list tag is always outputed.
  • Loading branch information
srba authored Jan 31, 2024
2 parents c03ada8 + 433c26e commit 025d57e
Showing 1 changed file with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@ public TimedArcPetriNetTrace parseTrace(BufferedReader reader) {

if(traceNameToParse != null) {
NodeList childNodes = null;
try {
childNodes = document.getElementsByTagName("trace-list").item(0).getChildNodes();
} catch (NullPointerException ex) {
// This just means the trace list is empty, i.e., there is no trace except the initial marking
// So we send this back
trace.setTraceName(traceNameToParse);
return trace;
}
for(int i = 0; i < childNodes.getLength(); i++) {
NamedNodeMap nodeAttribute = childNodes.item(i).getAttributes();

if(nodeAttribute != null && nodeAttribute.item(0).getNodeValue().equals(traceNameToParse)) {
nodeList = childNodes.item(i).getChildNodes();
trace.setTraceName(traceNameToParse);
break;
}
}
Node traceListNode = document.getElementsByTagName("trace-list").item(0);

if (traceListNode != null) {
childNodes = traceListNode.getChildNodes();
}

if (childNodes != null) {
for(int i = 0; i < childNodes.getLength(); i++) {
NamedNodeMap nodeAttribute = childNodes.item(i).getAttributes();

if(nodeAttribute != null && nodeAttribute.item(0).getNodeValue().equals(traceNameToParse)) {
nodeList = childNodes.item(i).getChildNodes();
trace.setTraceName(traceNameToParse);
break;
}
}
}
}

if(nodeList == null) {
Expand Down

0 comments on commit 025d57e

Please sign in to comment.