### Eclipse Workspace Patch 1.0 #P JMapViewer Index: src/org/openstreetmap/gui/jmapviewer/checkBoxTree/CheckBoxTree.java =================================================================== --- src/org/openstreetmap/gui/jmapviewer/checkBoxTree/CheckBoxTree.java (revision 36495) +++ src/org/openstreetmap/gui/jmapviewer/checkBoxTree/CheckBoxTree.java (working copy) @@ -117,13 +117,19 @@ } private static Boolean childStatus(DefaultMutableTreeNode node) { + int childCount = node.getChildCount(); + if (childCount == 0) return null; + Boolean status = data(node.getChildAt(0)).isSelected(); - for (int i = 1; i < node.getChildCount() && status != null; i++) { - if (!status.equals( - data(node.getChildAt(i)).isSelected() - )) + + for (int i = 1; i < childCount; i++) { + Boolean currentStatus = data(node.getChildAt(i)).isSelected(); + + if (!Objects.equals(status, currentStatus)) { return null; + } } + return status; }