From 814794126d232b11a67c06691ed5d5da6c32dd75 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 6 Oct 2015 16:12:42 +1300 Subject: Do not use Java 8 map method --- src/org/traccar/protocol/CityeasyProtocolEncoder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/org/traccar/protocol') diff --git a/src/org/traccar/protocol/CityeasyProtocolEncoder.java b/src/org/traccar/protocol/CityeasyProtocolEncoder.java index 9d15e9d5d..cfe69a462 100644 --- a/src/org/traccar/protocol/CityeasyProtocolEncoder.java +++ b/src/org/traccar/protocol/CityeasyProtocolEncoder.java @@ -49,11 +49,13 @@ public class CityeasyProtocolEncoder extends BaseProtocolEncoder { case Command.TYPE_POSITION_SINGLE: return encodeContent(CityeasyProtocolDecoder.MSG_LOCATION_REQUEST, content); case Command.TYPE_POSITION_PERIODIC: + content.writeShort(((Number) command.getAttributes().get(Command.KEY_FREQUENCY)).intValue()); + return encodeContent(CityeasyProtocolDecoder.MSG_LOCATION_INTERVAL, content); case Command.TYPE_POSITION_STOP: - content.writeShort(((Number) command.getAttributes().getOrDefault(Command.KEY_FREQUENCY, 0)).intValue()); + content.writeShort(0); return encodeContent(CityeasyProtocolDecoder.MSG_LOCATION_INTERVAL, content); case Command.TYPE_SET_TIMEZONE: - int timezone = ((Number) command.getAttributes().getOrDefault(Command.KEY_TIMEZONE, 0)).intValue(); + int timezone = ((Number) command.getAttributes().get(Command.KEY_TIMEZONE)).intValue(); content.writeByte(timezone < 0 ? 1 : 0); content.writeShort(Math.abs(timezone) / 60); return encodeContent(CityeasyProtocolDecoder.MSG_TIMEZONE, content); -- cgit v1.2.3