Browse Source

ignore spotbugs correctness for an android api array access with fixed index

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 2 years ago
parent
commit
925691299a
1 changed files with 4 additions and 0 deletions
  1. 4 0
      app/src/main/java/com/nextcloud/talk/utils/DisplayUtils.java

+ 4 - 0
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;
     }