From eb4ee7a9d4d0f132546b164c3483d62eb9e9f0db Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 8 Oct 2015 15:08:33 +1300 Subject: Clean up reported PMD issues --- src/org/traccar/protocol/MeiligaoProtocolDecoder.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/org/traccar/protocol/MeiligaoProtocolDecoder.java') diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java index f5ad46885..4584c1862 100644 --- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java +++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java @@ -92,17 +92,15 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { id += d1; // Second digit - int d2 = (b & 0x0f); + int d2 = b & 0x0f; if (d2 == 0xf) break; id += d2; } - if (id.length() == 14) { - // Try to recreate full IMEI number - // Sometimes first digit is cut, so this won't work - if (identify(id + Checksum.luhn(Long.parseLong(id)), channel, null, false)) { - return true; - } + // Try to recreate full IMEI number + // Sometimes first digit is cut, so this won't work + if (id.length() == 14 && identify(id + Checksum.luhn(Long.parseLong(id)), channel, null, false)) { + return true; } return identify(id, channel); -- cgit v1.2.3