facebook / facebook/infer

How to create a global filter/ignore for specific null dereference warnings?

Aperta
#1,133 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
question
Lingua principale
OCaml
Stelle
15.7k
Fork
2.1k
Merge medio
19h 36m
PR unite (30g)
13

Descrizione

When an Android project is changed to use `compileSdkVersion 28` and `targetSdkVersion 28` the Infer tool will generate lots of warnings in Fragments like this:

```
object returned by `getActivity()` could be null and is dereferenced at line xxx
object returned by `getArguments()` could be null and is dereferenced at line xxx
```

Is there a way to turn off these 2 specific warnings in all files? Is there a way to do it by adding annotations to the file, or by setting some sort of global setting outside the Java files?

I have checked the following issues, but I don't know if they apply to this situation:

https://github.com/facebook/infer/issues/150
https://github.com/facebook/infer/issues/935

----------

Please make sure your issue is not addressed in the [FAQ](http://fbinfer.com/support.html#troubleshooting).

Please include the following information:
- [x] The version of infer from `infer --version`. v0.16.0
- [x] Your operating system and version, for example "Debian 9", "MacOS High Sierra", whether you are using Docker, etc. Ubuntu Linux
- [x] Which command you ran, for example `infer -- make`. infer run -- ./gradlew assembleDebug
- [x] The full output in a paste, for instance a [gist](https://gist.github.com/).
- [ ] If possible, a minimal example to reproduce your problem (for instance, some code where
infer reports incorrectly, together with the way you run infer to reproduce the incorrect
report).

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.