-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make library models override annotations by default.
This change removes the short-lived `AcknowledgeLibraryModelsOfAnnotatedCode` configuration flag. It sets the behavior of NullAway to always allow library models to override the nullability of annotated code, with an important caveat regarding #445: Whenever we have a method `D.m` which overrides a method `C.m` for which we have a library model, NullAway's behavior depends on whether `D.m` is an annotated or unannotated method: 1) If `D.m` is within unannotated / third-party code, we consider the library model of `C.m` to extend to `D.m` (and to all such third-party overriding methods of `C.m`). This minimizes redundancy in our library models and makes them more robust to the changes within third-party library internals. 2) However, for an overriding `D.m` within annotated code, we don't propagate the library model, requiring either `D.m` to be annotated in a compatible manner or else a separate library model for it. This makes it so that libraries for which the user doesn't have the source code (i.e. can't add annotations), but which they wish to add to the `AnnotatedPackages` list, require more comprehensive library models than "unannotated" libraries. However, this is fully consistent with the intent behind marking code as annotated, which is stricter checking of its nullability.
- Loading branch information
1 parent
a8051cd
commit 044c39f
Showing
7 changed files
with
32 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters