diff options
author | Hans van den Elsen <hans.elsen@esds.nl> | 2016-03-14 20:49:04 +0100 |
---|---|---|
committer | Hans van den Elsen <hans.elsen@esds.nl> | 2016-03-14 20:49:04 +0100 |
commit | 7fd1c08dd2f789ddd37ff075a6ebda1645947616 (patch) | |
tree | 75b715e6dd70f6be3357e1710c4db6f1f6a1e29e /src/org/traccar/database/GroupTree.java | |
parent | 4606737cc07b736f9c8f98ae680b928c94c082c8 (diff) | |
parent | 0a1019b59481b6bf8ee8989feb23cef084b6caf5 (diff) | |
download | trackermap-server-7fd1c08dd2f789ddd37ff075a6ebda1645947616.tar.gz trackermap-server-7fd1c08dd2f789ddd37ff075a6ebda1645947616.tar.bz2 trackermap-server-7fd1c08dd2f789ddd37ff075a6ebda1645947616.zip |
Merge remote-tracking branch 'refs/remotes/tananaev/master'
Diffstat (limited to 'src/org/traccar/database/GroupTree.java')
-rw-r--r-- | src/org/traccar/database/GroupTree.java | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/org/traccar/database/GroupTree.java b/src/org/traccar/database/GroupTree.java index b383b1501..4a2321f58 100644 --- a/src/org/traccar/database/GroupTree.java +++ b/src/org/traccar/database/GroupTree.java @@ -33,11 +33,11 @@ public class GroupTree { private Device device; private Collection<TreeNode> children = new HashSet<>(); - public TreeNode(Group group) { + TreeNode(Group group) { this.group = group; } - public TreeNode(Device device) { + TreeNode(Device device) { this.device = device; } @@ -59,14 +59,10 @@ public class GroupTree { if (other == this) { return true; } - if (group != null) { - if (other.group != null) { - return group.getId() == other.group.getId(); - } - } else if (device != null) { - if (other.device != null) { - return device.getId() == other.device.getId(); - } + if (group != null && other.group != null) { + return group.getId() == other.group.getId(); + } else if (device != null && other.device != null) { + return device.getId() == other.device.getId(); } return false; } |