From 8d6a9d98da740390253d7a093e77a93850e084c1 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Wed, 27 Feb 2019 20:52:16 +0100 Subject: [PATCH] Silence lgtm error messages If the index would indeed be out of bounds, we would simply catch the exception and deal with that. --- .../devices/huami/amazfitbip/ActivityDetailsParser.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip/ActivityDetailsParser.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip/ActivityDetailsParser.java index 76bc40c4d..65b27d2aa 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip/ActivityDetailsParser.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip/ActivityDetailsParser.java @@ -91,8 +91,8 @@ public class ActivityDetailsParser { i++; } - byte type = bytes[i++]; - int timeOffset = BLETypeConversions.toUnsigned(bytes[i++]); + byte type = bytes[i++]; // lgtm [java/index-out-of-bounds]] + int timeOffset = BLETypeConversions.toUnsigned(bytes[i++]); // lgtm [java/index-out-of-bounds] // handle timeOffset overflows (1 byte, always increasing, relative to base) if (lastTimeOffset <= timeOffset) { timeOffset = timeOffset - lastTimeOffset;