From 925691299a0c4448cebfa14287571f7f02f238a3 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Wed, 22 Jun 2022 20:12:25 +0200 Subject: [PATCH] ignore spotbugs correctness for an android api array access with fixed index Signed-off-by: Andy Scherzinger --- app/src/main/java/com/nextcloud/talk/utils/DisplayUtils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/com/nextcloud/talk/utils/DisplayUtils.java b/app/src/main/java/com/nextcloud/talk/utils/DisplayUtils.java index d9e3ffe6d..70392597b 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/DisplayUtils.java +++ b/app/src/main/java/com/nextcloud/talk/utils/DisplayUtils.java @@ -490,9 +490,13 @@ public class DisplayUtils { * @param color the color * @return true if primaryColor is lighter than MAX_LIGHTNESS */ + @SuppressWarnings("correctness") public static boolean lightTheme(int color) { float[] hsl = colorToHSL(color); + // spotbugs dislikes fixed index access + // which is enforced by having such an + // array from Android-API itself return hsl[INDEX_LUMINATION] >= MAX_LIGHTNESS; }