Suppress potential NullPointerException in Android Studio

This works for me, but not sure why AS would want to use constant conditions as the suppressor. I think it has something to do with the skip null check as it’s a constant condition (i.e., it’ll always not be null).

@Nullable
Item[] mItems;

@SuppressWarnings("ConstantConditions")
public Item getItem(int position) {
    return mItems[position];
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)