Merge lp:~tapaal-contributor/tapaal/query-export-bug-1767615 into lp:tapaal

Proposed by Jiri Srba
Status: Merged
Approved by: Jiri Srba
Approved revision: 958
Merged at revision: 958
Proposed branch: lp:~tapaal-contributor/tapaal/query-export-bug-1767615
Merge into: lp:tapaal
Diff against target: 33 lines (+14/-3)
1 file modified
src/pipe/gui/Export.java (+14/-3)
To merge this branch: bzr merge lp:~tapaal-contributor/tapaal/query-export-bug-1767615
Reviewer Review Type Date Requested Status
Mads Johannsen (community) Approve
Review via email: mp+345346@code.launchpad.net

Commit message

Fixes problem with export of XML queries.

To post a comment you must log in.
Revision history for this message
Mads Johannsen (mjohan12) wrote :

Works. Tested on the attached bug report net, some handmade nets, and some of the example nets.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/pipe/gui/Export.java'
2--- src/pipe/gui/Export.java 2018-04-11 18:05:12 +0000
3+++ src/pipe/gui/Export.java 2018-05-10 09:14:51 +0000
4@@ -6,6 +6,9 @@
5 */
6 package pipe.gui;
7
8+import dk.aau.cs.TCTL.CTLParsing.TAPAALCTLQueryParser;
9+import dk.aau.cs.TCTL.TCTLAbstractProperty;
10+import dk.aau.cs.TCTL.TCTLPathPlaceHolder;
11 import java.awt.image.BufferedImage;
12 import java.awt.print.PageFormat;
13 import java.awt.print.PrinterException;
14@@ -96,9 +99,17 @@
15
16 while(queryIterator.hasNext()){
17 TAPNQuery clonedQuery = queryIterator.next().copy();
18- clonedQuery.getProperty().accept(new RenameAllPlacesVisitor(mapping), null);
19- clonedQuery.getProperty().accept(new RenameAllTransitionsVisitor(mapping), null);
20- XMLVisitor.buildXMLQuery(clonedQuery.getProperty(), clonedQuery.getName());
21+
22+ // Attempt to parse and possibly transform the string query using the manual edit parser
23+ TCTLAbstractProperty newProperty;
24+ try {
25+ newProperty = TAPAALCTLQueryParser.parse(clonedQuery.getProperty().toString());
26+ } catch (Throwable ex) {
27+ newProperty = clonedQuery == null ? new TCTLPathPlaceHolder() : clonedQuery.getProperty();
28+ }
29+ newProperty.accept(new RenameAllPlacesVisitor(mapping), null);
30+ newProperty.accept(new RenameAllTransitionsVisitor(mapping), null);
31+ XMLVisitor.buildXMLQuery(newProperty, clonedQuery.getName());
32 }
33 queryStream.print(XMLVisitor.getFormatted());
34

Subscribers

People subscribed via source and target branches