Como dizer ao IDEA / Studio que a verificação nula foi feita?

Estou desenvolvendo com o Android Studio / IntelliJ IDEA.

Eu habilitei a verificação de inspeção chamada "Condições e exceções constantes" que mostra um aviso se estou arriscando um NPE, como:

String foo = foo.bar(); // Foo#bar() is @nullable
if (foo.contains("bar")) { // I'm living dangerously
    ...
}

Eu tenho o seguinte no meu código:

String encoding = contentEncoding == null ? null : contentEncoding.getValue();
if (!TextUtils.isEmpty(encoding) && encoding.equalsIgnoreCase("gzip")) {
    inputStream = new GZIPInputStream(entity.getContent());
} else {
    inputStream = entity.getContent();
}

Aqui está o código fonte doTextUtils#isEmpty(String):

/**
 * Returns true if the string is null or 0-length.
 * @param str the string to be examined
 * @return true if str is null or zero length
 */
public static boolean isEmpty(CharSequence str) {
    if (str == null || str.length() == 0)
        return true;
    else
        return false;
}

Eu não estou arriscando nenhum NPE porqueTextUtils#isEmpty(String) retornaria verdadeiro para umnull ponteiro.

No entanto, eu ainda estou recebendo o pequenoMethod invocation 'encoding.equalsIgnoreCase("gzip")' may produce 'java.lang.NullPointerException' aviso, o que pode ser irritante.

É possível tornar essa verificação mais inteligente e ignorar o aviso do NPE se já houver uma verificação nula feita?

questionAnswers(5)

yourAnswerToTheQuestion