facebook / facebook/infer

java.util.Objects.isNull not recognized?

Open
#1,711 0 comments 2 reactions 0 assignees View on GitHub
question
Dominant language
OCaml
Stars
15.7k
Forks
2.1k
Avg merge
19h 36m
Merged PRs (30d)
13

Description

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

* Infer version v1.1.0
* Operating system MacOS Ventura
* Commands:
```
infer capture -- ./gradlew --offline clean assemble
infer analyze --fail-on-issue
```
* Example:

```
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.