Merge lp:~tapaal-contributor/tapaal/workflow-analysis-npe-1945821 into lp:tapaal

Proposed by Lena Ernstsen
Status: Merged
Approved by: Jiri Srba
Approved revision: 1149
Merged at revision: 1149
Proposed branch: lp:~tapaal-contributor/tapaal/workflow-analysis-npe-1945821
Merge into: lp:tapaal
Diff against target: 36 lines (+11/-1)
1 file modified
src/pipe/gui/KBoundAnalyzer.java (+11/-1)
To merge this branch: bzr merge lp:~tapaal-contributor/tapaal/workflow-analysis-npe-1945821
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Review via email: mp+409538@code.launchpad.net

Description of the change

Fixed NPE for untimed nets when running boundedness check in workflow analysis

To post a comment you must log in.
Revision history for this message
Jiri Srba (srba) wrote :

Fixes the issue.

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/KBoundAnalyzer.java'
2--- src/pipe/gui/KBoundAnalyzer.java 2021-09-23 11:36:16 +0000
3+++ src/pipe/gui/KBoundAnalyzer.java 2021-10-02 12:07:31 +0000
4@@ -8,6 +8,7 @@
5 import dk.aau.cs.util.Tuple;
6 import dk.aau.cs.verification.NameMapping;
7 import dk.aau.cs.verification.TAPNComposer;
8+import pipe.dataLayer.DataLayer;
9 import pipe.dataLayer.TAPNQuery.SearchOption;
10 import pipe.dataLayer.TAPNQuery.TraceOption;
11 import pipe.dataLayer.TAPNQuery.AlgorithmOption;
12@@ -26,6 +27,7 @@
13 import dk.aau.cs.verification.VerifyTAPN.VerifyTAPNOptions;
14
15 import java.util.ArrayList;
16+import java.util.HashMap;
17
18 public class KBoundAnalyzer {
19 protected TimedArcPetriNetNetwork tapnNetwork;
20@@ -114,7 +116,15 @@
21 }
22
23 private TimedArcPetriNet mergeNetComponents() {
24- TAPNComposer composer = new TAPNComposer(new MessengerImpl(), CreateGui.getCurrentTab().getGuiModels(), true, true);
25+ HashMap<TimedArcPetriNet, DataLayer> guiModels = CreateGui.getCurrentTab().getGuiModels();
26+ for (TimedArcPetriNet net : guiModels.keySet()) {
27+ if (tapnNetwork.getTAPNByName(net.name()) != null) {
28+ DataLayer dl = guiModels.get(net);
29+ guiModels.remove(net);
30+ guiModels.put(tapnNetwork.getTAPNByName(net.name()), dl);
31+ }
32+ }
33+ TAPNComposer composer = new TAPNComposer(new MessengerImpl(), guiModels, true, true);
34 Tuple<TimedArcPetriNet, NameMapping> transformedModel = composer.transformModel(tapnNetwork);
35
36 return transformedModel.value1();

Subscribers

People subscribed via source and target branches