'Suppress warning ~ Actual value of parameter X is always Y

My Android Java code has a class that includes cancel method:

private void hide(int aniDuration) {
    if (!isVisible) return;
    if (runnable != null) handler.removeCallbacks(runnable);
    isVisible = false;
    if (aniDuration > 0) {
        fadeInOut(false, aniDuration);
    }
    else {
        notifierLayout.setAlpha(0.0f);
        notifierLayout.setVisibility(View.GONE);
    }
}

private void hide() { hide(animateDuration); }

@SuppressWarnings({"unused", "WeakerAccess"})
public void cancel() { hide(); }

@SuppressWarnings({"unused", "WeakerAccess"})
public void cancel(int aniDuration) {
    hide(aniDuration);
}

But since (so far) I call this cancel method just once with the parameter aniDuration = 0, the Android Studio debugger shows the following warning message:

Actual value of parameter "aniDuration" is always "0"

enter image description here

Besides of using @SuppressWarnings("all"), how could I suppress this type of warning?



Solution 1:[1]

File > Settings > Editor > Inspections > Find:"Actual method parameter is the same constant" uncheck and android studio restart

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Yusuf Ya?ar