From 03dc6436216c90fc6f6914afb5807659a71201de Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 23 Nov 2016 17:39:07 +0500 Subject: One more place --- src/org/traccar/database/DeviceManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/org/traccar/database') diff --git a/src/org/traccar/database/DeviceManager.java b/src/org/traccar/database/DeviceManager.java index 5681602fe..e0b7fd2db 100644 --- a/src/org/traccar/database/DeviceManager.java +++ b/src/org/traccar/database/DeviceManager.java @@ -408,7 +408,7 @@ public class DeviceManager implements IdentityManager { long groupId = device.getGroupId(); while (groupId != 0) { if (getGroupById(groupId) != null) { - result = (String) getGroupById(groupId).getAttributes().get(attributeName); + result = getGroupById(groupId).getString(attributeName); if (result != null) { break; } -- cgit v1.2.3 From ef0b4ac118c3c430c3046d35229aa48cdb65e25d Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 23 Nov 2016 17:49:36 +0500 Subject: Some more places --- src/org/traccar/database/DeviceManager.java | 6 ++---- src/org/traccar/notification/PropertiesProvider.java | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src/org/traccar/database') diff --git a/src/org/traccar/database/DeviceManager.java b/src/org/traccar/database/DeviceManager.java index e0b7fd2db..600669579 100644 --- a/src/org/traccar/database/DeviceManager.java +++ b/src/org/traccar/database/DeviceManager.java @@ -401,9 +401,7 @@ public class DeviceManager implements IdentityManager { String result = null; Device device = getDeviceById(deviceId); if (device != null) { - if (device.getAttributes().containsKey(attributeName)) { - result = (String) device.getAttributes().get(attributeName); - } + result = device.getString(attributeName); if (result == null && lookupGroupsAttribute) { long groupId = device.getGroupId(); while (groupId != 0) { @@ -421,7 +419,7 @@ public class DeviceManager implements IdentityManager { if (result == null) { if (lookupServer) { Server server = Context.getPermissionsManager().getServer(); - result = (String) server.getAttributes().get(attributeName); + result = server.getString(attributeName); } else { result = Context.getConfig().getString(attributeName); } diff --git a/src/org/traccar/notification/PropertiesProvider.java b/src/org/traccar/notification/PropertiesProvider.java index 9136288f8..e7cac8d0f 100644 --- a/src/org/traccar/notification/PropertiesProvider.java +++ b/src/org/traccar/notification/PropertiesProvider.java @@ -36,7 +36,7 @@ public class PropertiesProvider { if (config != null) { return config.getString(key); } else { - return (String) extensible.getAttributes().get(key); + return extensible.getString(key); } } -- cgit v1.2.3