Merge lp:~tapaal-contributor/tapaal/cpn-caseSensitivity into lp:~tapaal-contributor/tapaal/cpn-gui-dev

Proposed by Kenneth Yrke Jørgensen
Status: Merged
Approved by: Jiri Srba
Approved revision: 1614
Merged at revision: 1615
Proposed branch: lp:~tapaal-contributor/tapaal/cpn-caseSensitivity
Merge into: lp:~tapaal-contributor/tapaal/cpn-gui-dev
Diff against target: 338 lines (+34/-33)
12 files modified
src/dk/aau/cs/io/LoadTACPN.java (+1/-0)
src/dk/aau/cs/model/tapn/ConstantStore.java (+4/-4)
src/dk/aau/cs/model/tapn/TimedArcPetriNet.java (+4/-4)
src/dk/aau/cs/model/tapn/TimedArcPetriNetNetwork.java (+13/-13)
src/net/tapaal/gui/petrinet/editor/ColorTypeDialogPanel.java (+4/-4)
src/net/tapaal/gui/petrinet/editor/ConstantsDialogPanel.java (+1/-1)
src/net/tapaal/gui/petrinet/editor/SharedPlaceNamePanel.java (+1/-1)
src/net/tapaal/gui/petrinet/editor/SharedTransitionNamePanel.java (+1/-1)
src/net/tapaal/gui/petrinet/editor/TemplateExplorer.java (+1/-1)
src/net/tapaal/gui/petrinet/editor/VariablesDialogPanel.java (+2/-2)
src/pipe/gui/petrinet/editor/PlaceEditorPanel.java (+1/-1)
src/pipe/gui/petrinet/editor/TAPNTransitionEditor.java (+1/-1)
To merge this branch: bzr merge lp:~tapaal-contributor/tapaal/cpn-caseSensitivity
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Review via email: mp+415949@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jiri Srba (srba) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/dk/aau/cs/io/LoadTACPN.java'
2--- src/dk/aau/cs/io/LoadTACPN.java 2022-01-09 18:33:52 +0000
3+++ src/dk/aau/cs/io/LoadTACPN.java 2022-02-23 08:27:59 +0000
4@@ -322,6 +322,7 @@
5 }
6 }
7
8+ /// This will select the wrong color if the is overlap in naming, eg for IntegerRangeExpr (1,2,3,4) & (1,2)
9 private dk.aau.cs.model.CPN.Color getColor(String colorname) throws FormatException {
10 for (ColorType ct : colortypes.values()) {
11 for (dk.aau.cs.model.CPN.Color c : ct) {
12
13=== modified file 'src/dk/aau/cs/model/tapn/ConstantStore.java'
14--- src/dk/aau/cs/model/tapn/ConstantStore.java 2022-01-09 18:09:13 +0000
15+++ src/dk/aau/cs/model/tapn/ConstantStore.java 2022-02-23 08:27:59 +0000
16@@ -74,7 +74,7 @@
17
18 public boolean containsConstantByName(String name) {
19 for(Constant c : constants) {
20- if(c.name().equalsIgnoreCase(name))
21+ if(c.name().equals(name))
22 return true;
23 }
24 return false;
25@@ -82,7 +82,7 @@
26
27 public Constant getConstantByName(String name) {
28 for(Constant c : constants) {
29- if(c.name().equalsIgnoreCase(name))
30+ if(c.name().equals(name))
31 return c;
32 }
33 return null;
34@@ -218,11 +218,11 @@
35 }
36
37 private boolean isNameInf(String name) {
38- return name.equalsIgnoreCase("inf");
39+ return name.equals("inf");
40 }
41
42 public Command updateConstant(String oldName, Constant updatedConstant, TimedArcPetriNetNetwork model) {
43- if (oldName.equalsIgnoreCase(updatedConstant.name()) || !containsConstantByName(updatedConstant.name())) {
44+ if (oldName.equals(updatedConstant.name()) || !containsConstantByName(updatedConstant.name())) {
45 if (containsConstantByName(oldName)) {
46 Constant old = getConstantByName(oldName);
47 updatedConstant.setLowerBound(old.lowerBound());
48
49=== modified file 'src/dk/aau/cs/model/tapn/TimedArcPetriNet.java'
50--- src/dk/aau/cs/model/tapn/TimedArcPetriNet.java 2022-02-10 07:46:25 +0000
51+++ src/dk/aau/cs/model/tapn/TimedArcPetriNet.java 2022-02-23 08:27:59 +0000
52@@ -259,12 +259,12 @@
53 if(parentNetwork != null && parentNetwork.isNameUsedForShared(name)) return true;
54
55 for (TimedPlace place : places){
56- if (place.name().equalsIgnoreCase(name)){
57+ if (place.name().equals(name)){
58 return true;
59 }
60 }
61 for (TimedTransition transition : transitions){
62- if (transition.name().equalsIgnoreCase(name)){
63+ if (transition.name().equals(name)){
64 return true;
65 }
66 }
67@@ -287,7 +287,7 @@
68
69 public TimedPlace getPlaceByName(String placeName) {
70 for (TimedPlace p : places) {
71- if (p.name().equalsIgnoreCase(placeName)) {
72+ if (p.name().equals(placeName)) {
73 return p;
74 }
75 }
76@@ -296,7 +296,7 @@
77
78 public TimedTransition getTransitionByName(String transitionName) {
79 for (TimedTransition t : transitions) {
80- if (t.name().equalsIgnoreCase(transitionName)) {
81+ if (t.name().equals(transitionName)) {
82 return t;
83 }
84 }
85
86=== modified file 'src/dk/aau/cs/model/tapn/TimedArcPetriNetNetwork.java'
87--- src/dk/aau/cs/model/tapn/TimedArcPetriNetNetwork.java 2022-01-09 19:10:28 +0000
88+++ src/dk/aau/cs/model/tapn/TimedArcPetriNetNetwork.java 2022-02-23 08:27:59 +0000
89@@ -95,13 +95,13 @@
90
91 public boolean isNameUsedForShared(String name){
92 for(SharedTransition transition : sharedTransitions){
93- if(transition.name().equalsIgnoreCase(name)) {
94+ if(transition.name().equals(name)) {
95 return true;
96 }
97 }
98
99 for(SharedPlace place : sharedPlaces){
100- if(place.name().equalsIgnoreCase(name)) {
101+ if(place.name().equals(name)) {
102 return true;
103 }
104 }
105@@ -119,7 +119,7 @@
106 public boolean isNameUsedForPlacesOnly(String name) {
107 for(TimedArcPetriNet net : tapns){
108 for(TimedTransition transition : net.transitions()) {
109- if(name.equalsIgnoreCase(transition.name()))
110+ if(name.equals(transition.name()))
111 return false;
112 }
113 }
114@@ -128,7 +128,7 @@
115 public boolean isNameUsedForTransitionsOnly(String name) {
116 for(TimedArcPetriNet net : tapns){
117 for(TimedPlace place : net.places()) {
118- if(name.equalsIgnoreCase(place.name()))
119+ if(name.equals(place.name()))
120 return false;
121 }
122 }
123@@ -366,14 +366,14 @@
124
125 public SharedTransition getSharedTransitionByName(String name) {
126 for(SharedTransition t : sharedTransitions){
127- if(t.name().equalsIgnoreCase(name)) return t;
128+ if(t.name().equals(name)) return t;
129 }
130 return null;
131 }
132
133 public TimedPlace getSharedPlaceByName(String name) {
134 for(SharedPlace place : sharedPlaces){
135- if(place.name().equalsIgnoreCase(name)) return place;
136+ if(place.name().equals(name)) return place;
137 }
138 return null;
139 }
140@@ -660,7 +660,7 @@
141
142 public Integer getColorTypeIndex(String name) {
143 for (int i = 0; i < colorTypes.size(); i++) {
144- if (colorTypes.get(i).getName().equalsIgnoreCase(name)) {
145+ if (colorTypes.get(i).getName().equals(name)) {
146 return i;
147 }
148 }
149@@ -668,7 +668,7 @@
150 }
151 public ColorType getColorTypeByName(String name) {
152 for (ColorType element : colorTypes) {
153- if (element.getName().equalsIgnoreCase(name)) {
154+ if (element.getName().equals(name)) {
155 return element;
156 }
157 }
158@@ -677,7 +677,7 @@
159
160 public Integer getVariableIndex(String name) {
161 for (int i = 0; i < variables.size(); i++) {
162- if (variables.get(i).getName().equalsIgnoreCase(name)) {
163+ if (variables.get(i).getName().equals(name)) {
164 return i;
165 }
166 }
167@@ -686,7 +686,7 @@
168
169 public boolean isNameUsedForColorType(String name) {
170 for (ColorType element : colorTypes) {
171- if (element.getName().equalsIgnoreCase(name)) {
172+ if (element.getName().equals(name)) {
173 return true;
174 }
175 }
176@@ -694,7 +694,7 @@
177 }
178 public boolean isNameUsedForVariable(String name) {
179 for (Variable element : variables) {
180- if (element.getName().equalsIgnoreCase(name)) {
181+ if (element.getName().equals(name)) {
182 return true;
183 }
184 }
185@@ -704,7 +704,7 @@
186 for (ColorType e : colorTypes) {
187 if (e != ignored && !e.isIntegerRange() && !e.isProductColorType()){
188 for (Color c : e.getColors()) {
189- if (c.getName().equalsIgnoreCase(name)) {
190+ if (c.getName().equals(name)) {
191 return true;
192 }
193 }
194@@ -718,7 +718,7 @@
195
196 public Variable getVariableByName(String name){
197 for (Variable variable : variables) {
198- if (variable.getName().equalsIgnoreCase(name)) {
199+ if (variable.getName().equals(name)) {
200 return variable;
201 }
202 }
203
204=== modified file 'src/net/tapaal/gui/petrinet/editor/ColorTypeDialogPanel.java'
205--- src/net/tapaal/gui/petrinet/editor/ColorTypeDialogPanel.java 2022-01-09 19:10:28 +0000
206+++ src/net/tapaal/gui/petrinet/editor/ColorTypeDialogPanel.java 2022-02-23 08:27:59 +0000
207@@ -445,11 +445,11 @@
208 "The color cannot be named \"" + enumerationName + "\", as the name is reserved",
209 "Error", JOptionPane.ERROR_MESSAGE);
210 } else {
211- boolean nameIsInUse = network.isNameUsedForVariable(enumerationName) || network.isNameUsedForColor(enumerationName, null) || network.isNameUsedForColorType(enumerationName) || network.isNameUsedForConstant(enumerationName) || nameTextField.getText().equalsIgnoreCase(enumerationName);
212+ boolean nameIsInUse = network.isNameUsedForVariable(enumerationName) || network.isNameUsedForColor(enumerationName, null) || network.isNameUsedForColorType(enumerationName) || network.isNameUsedForConstant(enumerationName) || nameTextField.getText().equals(enumerationName);
213 for (int i = 0; i < cyclicModel.getSize(); i++) {
214 String n = cyclicModel.getElementAt(i).toString();
215
216- if (n.equalsIgnoreCase(enumerationName)) {
217+ if (n.equals(enumerationName)) {
218 nameIsInUse = true;
219 break;
220 }
221@@ -896,7 +896,7 @@
222 "Error", JOptionPane.ERROR_MESSAGE);
223 return;
224 }
225- if (!oldName.equals("") && !oldName.equalsIgnoreCase(name) && network.isNameUsedForColorType(name)) {
226+ if (!oldName.equals("") && !oldName.equals(name) && network.isNameUsedForColorType(name)) {
227 JOptionPane.showMessageDialog(
228 TAPAALGUI.getApp(),
229 "There is already another color type with the same name.\n\n"
230@@ -981,7 +981,7 @@
231 ArrayList<String> overlaps = new ArrayList<>();
232 for (int i = 0; i < enumList.getModel().getSize(); i++) {
233 String e = enumList.getModel().getElementAt(i).toString();
234- if (network.isNameUsedForVariable(e) || network.isNameUsedForColor(e, oldColorType) || network.isNameUsedForColorType(e) || network.isNameUsedForConstant(e) || name.equalsIgnoreCase(e)) {
235+ if (network.isNameUsedForVariable(e) || network.isNameUsedForColor(e, oldColorType) || network.isNameUsedForColorType(e) || network.isNameUsedForConstant(e) || name.equals(e)) {
236 overlaps.add(e);
237 }
238 }
239
240=== modified file 'src/net/tapaal/gui/petrinet/editor/ConstantsDialogPanel.java'
241--- src/net/tapaal/gui/petrinet/editor/ConstantsDialogPanel.java 2022-01-09 16:01:49 +0000
242+++ src/net/tapaal/gui/petrinet/editor/ConstantsDialogPanel.java 2022-02-23 08:27:59 +0000
243@@ -212,7 +212,7 @@
244 } else {
245 int val = (Integer) valueSpinner.getValue();
246 if (!oldName.equals("")) {
247- if (!oldName.equalsIgnoreCase(newName)
248+ if (!oldName.equals(newName)
249 && model.isNameUsedForConstant(newName)) {
250 JOptionPane
251 .showMessageDialog(
252
253=== modified file 'src/net/tapaal/gui/petrinet/editor/SharedPlaceNamePanel.java'
254--- src/net/tapaal/gui/petrinet/editor/SharedPlaceNamePanel.java 2022-01-09 16:46:17 +0000
255+++ src/net/tapaal/gui/petrinet/editor/SharedPlaceNamePanel.java 2022-02-23 08:27:59 +0000
256@@ -137,7 +137,7 @@
257 private boolean updateExistingPlace(String name) {
258 String oldName = placeToEdit.name();
259
260- if(placeToEdit.network().isNameUsed(name) && !oldName.equalsIgnoreCase(name)) {
261+ if(placeToEdit.network().isNameUsed(name) && !oldName.equals(name)) {
262 JOptionPane.showMessageDialog(SharedPlaceNamePanel.this, "The specified name is already used by a place or transition in one of the components.", "Error", JOptionPane.ERROR_MESSAGE);
263 nameField.requestFocusInWindow();
264 return false;
265
266=== modified file 'src/net/tapaal/gui/petrinet/editor/SharedTransitionNamePanel.java'
267--- src/net/tapaal/gui/petrinet/editor/SharedTransitionNamePanel.java 2022-01-09 16:46:17 +0000
268+++ src/net/tapaal/gui/petrinet/editor/SharedTransitionNamePanel.java 2022-02-23 08:27:59 +0000
269@@ -140,7 +140,7 @@
270
271 String oldName = transitionToEdit.name();
272
273- if(transitionToEdit.network().isNameUsed(name) && !oldName.equalsIgnoreCase(name)) {
274+ if(transitionToEdit.network().isNameUsed(name) && !oldName.equals(name)) {
275 JOptionPane.showMessageDialog(SharedTransitionNamePanel.this, "The specified name is already used by a place or transition in one of the components.", "Error", JOptionPane.ERROR_MESSAGE);
276 nameField.requestFocusInWindow();
277 return false;
278
279=== modified file 'src/net/tapaal/gui/petrinet/editor/TemplateExplorer.java'
280--- src/net/tapaal/gui/petrinet/editor/TemplateExplorer.java 2022-02-11 09:08:00 +0000
281+++ src/net/tapaal/gui/petrinet/editor/TemplateExplorer.java 2022-02-23 08:27:59 +0000
282@@ -442,7 +442,7 @@
283 showRenameTemplateDialog(newName);
284 return;
285 }
286- else if (parent.network().hasTAPNCalled(newName) && !template.model().name().equalsIgnoreCase(newName)) {
287+ else if (parent.network().hasTAPNCalled(newName) && !template.model().name().equals(newName)) {
288 JOptionPane.showMessageDialog(
289 parent.drawingSurface(),
290 "A component named \"" + newName + "\" already exists. Try another name.",
291
292=== modified file 'src/net/tapaal/gui/petrinet/editor/VariablesDialogPanel.java'
293--- src/net/tapaal/gui/petrinet/editor/VariablesDialogPanel.java 2022-01-09 16:46:17 +0000
294+++ src/net/tapaal/gui/petrinet/editor/VariablesDialogPanel.java 2022-02-23 08:27:59 +0000
295@@ -258,7 +258,7 @@
296 return;
297 }
298 //If we are editing a variable it is allowed to have the same name
299- if ((variable == null || !variable.getName().equalsIgnoreCase(newName)) && network.isNameUsedForVariable(newName) ) {
300+ if ((variable == null || !variable.getName().equals(newName)) && network.isNameUsedForVariable(newName) ) {
301 JOptionPane
302 .showMessageDialog(
303 TAPAALGUI.getApp(),
304@@ -268,7 +268,7 @@
305 nameTextField.requestFocusInWindow();
306 return;
307 }
308- if (!oldName.equals("") && !oldName.equalsIgnoreCase(newName) && network.isNameUsedForVariable(newName)) {
309+ if (!oldName.equals("") && !oldName.equals(newName) && network.isNameUsedForVariable(newName)) {
310 JOptionPane
311 .showMessageDialog(
312 TAPAALGUI.getApp(),
313
314=== modified file 'src/pipe/gui/petrinet/editor/PlaceEditorPanel.java'
315--- src/pipe/gui/petrinet/editor/PlaceEditorPanel.java 2022-01-09 19:10:28 +0000
316+++ src/pipe/gui/petrinet/editor/PlaceEditorPanel.java 2022-02-23 08:27:59 +0000
317@@ -623,7 +623,7 @@
318
319 String newName = nameTextField.getText();
320 String oldName = place.underlyingPlace().name();
321- if(context.activeModel().isNameUsed(newName) && !oldName.equalsIgnoreCase(newName)){
322+ if(context.activeModel().isNameUsed(newName) && !oldName.equals(newName)){
323 context.undoManager().undo();
324 JOptionPane.showMessageDialog(this, "The specified name is already used by another place or transition.", "Error", JOptionPane.ERROR_MESSAGE);
325 return false;
326
327=== modified file 'src/pipe/gui/petrinet/editor/TAPNTransitionEditor.java'
328--- src/pipe/gui/petrinet/editor/TAPNTransitionEditor.java 2022-01-07 16:58:59 +0000
329+++ src/pipe/gui/petrinet/editor/TAPNTransitionEditor.java 2022-02-23 08:27:59 +0000
330@@ -402,7 +402,7 @@
331 return false;
332 }
333 }else{
334- if(transition.underlyingTransition().model().isNameUsed(newName) && (wasShared || !transition.underlyingTransition().name().equalsIgnoreCase(newName))){
335+ if(transition.underlyingTransition().model().isNameUsed(newName) && (wasShared || !transition.underlyingTransition().name().equals(newName))){
336 context.undoManager().undo();
337 JOptionPane.showMessageDialog(this,
338 "The specified name is already used by another place or transition.",

Subscribers

People subscribed via source and target branches

to all changes: