From f8b3d5cc7286726e7719ddcd4db8d8456aa6e01f Mon Sep 17 00:00:00 2001 From: Philipp Prangenberg Date: Tue, 6 Dec 2016 08:55:11 +0100 Subject: Style changes --- src/org/traccar/BaseProtocolDecoder.java | 7 ++++--- src/org/traccar/database/DeviceManager.java | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/org/traccar/BaseProtocolDecoder.java b/src/org/traccar/BaseProtocolDecoder.java index 9e04fa5cd..103a999b0 100644 --- a/src/org/traccar/BaseProtocolDecoder.java +++ b/src/org/traccar/BaseProtocolDecoder.java @@ -40,10 +40,11 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { device.setUniqueId(uniqueId); device.setCategory(Context.getConfig().getString("database.registerUnknown.defaultCategory", "default")); - if(!defaultGroupName.equals("NOTDEFINED")){ + if (!defaultGroupName.equals("NOTDEFINED")) { Group defaultGroup = Context.getDeviceManager().getGroupByName(defaultGroupName); - if(defaultGroup != null) + if (defaultGroup != null) { device.setGroupId(defaultGroup.getId()); + } } try { @@ -192,4 +193,4 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { } } -} \ No newline at end of file +} diff --git a/src/org/traccar/database/DeviceManager.java b/src/org/traccar/database/DeviceManager.java index f442317d3..403953d56 100644 --- a/src/org/traccar/database/DeviceManager.java +++ b/src/org/traccar/database/DeviceManager.java @@ -246,7 +246,7 @@ public class DeviceManager implements IdentityManager { if (groupsById == null) { groupsById = new ConcurrentHashMap<>(databaseGroups.size()); } - if(groupsByName == null){ + if (groupsByName == null) { groupsByName = new ConcurrentHashMap<>(databaseGroups.size()); } Set databaseGroupsIds = new HashSet<>(); @@ -274,7 +274,9 @@ public class DeviceManager implements IdentityManager { return groupsById.get(id); } - public Group getGroupByName(String name) { return groupsByName.get(name); } + public Group getGroupByName(String name) { + return groupsByName.get(name); + } public Collection getAllGroups() { boolean forceUpdate = groupsById.isEmpty(); -- cgit v1.2.3