From ae32084f88df4436e1a2cdcb346ff1e7e286e369 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 17 Oct 2018 16:52:38 +1300 Subject: Avoid protocol classes in tests --- src/org/traccar/BaseProtocolDecoder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/org/traccar/BaseProtocolDecoder.java b/src/org/traccar/BaseProtocolDecoder.java index 2914fc3ac..8f495900a 100644 --- a/src/org/traccar/BaseProtocolDecoder.java +++ b/src/org/traccar/BaseProtocolDecoder.java @@ -39,6 +39,8 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { private static final Logger LOGGER = LoggerFactory.getLogger(BaseProtocolDecoder.class); + private static final String PROTOCOL_UNKNOWN = "unknown"; + private final Config config = Context.getConfig(); private final IdentityManager identityManager = Context.getIdentityManager(); private final ConnectionManager connectionManager = Context.getConnectionManager(); @@ -50,7 +52,7 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { } public String getProtocolName() { - return protocol != null ? protocol.getName() : null; + return protocol != null ? protocol.getName() : PROTOCOL_UNKNOWN; } public String getServer(Channel channel) { -- cgit v1.2.3