facebook / infer

A static analyzer for Java, C, C++, and Objective-C
http://fbinfer.com/
MIT License
14.83k stars 2k forks source link

java.util.Objects.isNull not recognized? #1711

Open System25 opened 1 year ago

System25 commented 1 year ago

Hi, it seems that Infer is not recognizing the "isNull" method in java.utils.Objects.

01. var client = getClient();
02. if (java.util.Objects.isNull(client)) {
03.      throw new RuntimeException("client is null");
04. }
05. final var data = client.getData();

This codes produces a error: Null Dereference object client last assigned on line 01 could be null and is dereferenced at line 05. The same code does not produce error if I replace "java.util.Objects.isNull(client)" by "client == null".

Thanks