Ticket #24674: patch_24674.txt

File patch_24674.txt, 1.1 KB (added by DanProgs <Abenteurer.2901@…>, 5 days ago)
Line 
1### Eclipse Workspace Patch 1.0
2#P JMapViewer
3Index: src/org/openstreetmap/gui/jmapviewer/checkBoxTree/CheckBoxTree.java
4===================================================================
5--- src/org/openstreetmap/gui/jmapviewer/checkBoxTree/CheckBoxTree.java (revision 36495)
6+++ src/org/openstreetmap/gui/jmapviewer/checkBoxTree/CheckBoxTree.java (working copy)
7@@ -117,13 +117,19 @@
8 }
9
10 private static Boolean childStatus(DefaultMutableTreeNode node) {
11+ int childCount = node.getChildCount();
12+ if (childCount == 0) return null;
13+
14 Boolean status = data(node.getChildAt(0)).isSelected();
15- for (int i = 1; i < node.getChildCount() && status != null; i++) {
16- if (!status.equals(
17- data(node.getChildAt(i)).isSelected()
18- ))
19+
20+ for (int i = 1; i < childCount; i++) {
21+ Boolean currentStatus = data(node.getChildAt(i)).isSelected();
22+
23+ if (!Objects.equals(status, currentStatus)) {
24 return null;
25+ }
26 }
27+
28 return status;
29 }
30