intellij idea - Android Studio nullability annoying warning -


the problem:

@nullable private view view;  public dosomethingwithview() {    checknotnull(view); //<- throws npe if parameter null    view.showwarningaboutissue(); //<- ide reports possible null here } 

is there way configure ide, doesn't report possible npe on second line?

update: i'm using dagger checknotnull method identical guava ones. if change import dagger guava ide removes warning.

update #2 latest update of android studio can not reproduce anymore

you need add following comment before view.showwarningaboutissue() statement:

//noinspection constantconditions 

this can performed gui : alt+enter (or "bubblelight" menu), choose assert view!=null , suppress statement:

enter image description here


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -