From 0a1019b59481b6bf8ee8989feb23cef084b6caf5 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 14 Mar 2016 14:48:39 +1300 Subject: Fix PMD and CheckStyle issues --- src/org/traccar/database/GroupTree.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/org/traccar/database') 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 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; } -- cgit v1.2.3