From 78d6ad3a1f3a5013b52cf59e9c55d0e0f0b3a33c Mon Sep 17 00:00:00 2001 From: "Martin.JM" Date: Sun, 24 Nov 2024 11:28:22 +0100 Subject: [PATCH] Huawei: Fix some linter warnings --- .../gadgetbridge/devices/huawei/packets/Weather.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/packets/Weather.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/packets/Weather.java index e1fe67d66..8f5142363 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/packets/Weather.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/packets/Weather.java @@ -16,6 +16,8 @@ along with this program. If not, see . */ package nodomain.freeyourgadget.gadgetbridge.devices.huawei.packets; +import androidx.annotation.NonNull; + import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -401,9 +403,9 @@ public class Weather { if (windDirection != null) { if (windDirection > 0) - wind |= ((short) (windDirection * 8 / 360)) << 8; + wind |= (short) (((short) (windDirection * 8 / 360)) << 8); else - wind |= ((short) (360 + windDirection) * 8 / 360) << 8; + wind |= (short) (((short) (360 + windDirection) * 8 / 360) << 8); } tlv81.put(0x03, wind); } @@ -585,6 +587,7 @@ public class Weather { public WeatherIcon icon; public Byte temperature; + @NonNull @Override public String toString() { String timestampStr = new Date(timestamp * 1000L).toString(); @@ -608,6 +611,7 @@ public class Weather { public Integer moonSetTime; public MoonPhase moonPhase; + @NonNull @Override public String toString() { String timestampStr = new Date(timestamp * 1000L).toString();