Android Studio: suppress lint warning for if statement -


i have code somewhere in android project:

public boolean isloadinprogress(boolean privateload, boolean publicload) {     if (privateload && privateloadinprogress) {         return true;     }     if (publicload && publicloadinprogress) {         return true;     }     return false; } 

i lint warning @ second if statement: 'if' statement simplified. that's because write well:

return publicload && publicloadinprogress; 

however, keep way readability. know there inline comment annotation switching off lint warning @ place, can't find in android lint documentation. can tell me annotation/comment was?

the simple code comment disabling warning is:

//noinspection simplifiableifstatement 

this on top of if-statement should switch off warning @ place.

in example, be:

public boolean isloadinprogress(boolean privateload, boolean publicload) {     if (privateload && privateloadinprogress) {         return true;     }      //noinspection simplifiableifstatement     if (publicload && publicloadinprogress) {         return true;     }     return false; } 

Comments

Popular posts from this blog

java - OnDragListener Fires Several Times? -

c# - ajax - How to receive data both html and json from server? -