aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/events
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-09-21 14:10:58 +0500
committerAbyss777 <abyss@fox5.ru>2016-09-21 14:10:58 +0500
commitfbe0190e65ee0646f6521cfca31ecfa3efa10472 (patch)
treef645e0e2eecfcd385bfebeb224fc66092ec5c20c /src/org/traccar/events
parentd0ce4c7e8069fc4663e2d04f942d8f8989be2998 (diff)
downloadtrackermap-server-fbe0190e65ee0646f6521cfca31ecfa3efa10472.tar.gz
trackermap-server-fbe0190e65ee0646f6521cfca31ecfa3efa10472.tar.bz2
trackermap-server-fbe0190e65ee0646f6521cfca31ecfa3efa10472.zip
Implement lookup attribute helpers for primitives
Diffstat (limited to 'src/org/traccar/events')
-rw-r--r--src/org/traccar/events/OverspeedEventHandler.java8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/org/traccar/events/OverspeedEventHandler.java b/src/org/traccar/events/OverspeedEventHandler.java
index a32dfae7e..57f60d864 100644
--- a/src/org/traccar/events/OverspeedEventHandler.java
+++ b/src/org/traccar/events/OverspeedEventHandler.java
@@ -47,12 +47,8 @@ public class OverspeedEventHandler extends BaseEventHandler {
Collection<Event> events = new ArrayList<>();
double speed = position.getSpeed();
- double speedLimit = 0;
- String speedLimitAttribute = Context.getDeviceManager()
- .lookupServerAttribute(device.getId(), ATTRIBUTE_SPEED_LIMIT);
- if (speedLimitAttribute != null) {
- speedLimit = Double.parseDouble(speedLimitAttribute);
- }
+ double speedLimit = Context.getDeviceManager()
+ .lookupServerDouble(device.getId(), ATTRIBUTE_SPEED_LIMIT, 0);
if (speedLimit == 0) {
return null;
}