Commit a1df1c4
authored
Always acknowledge restrictive annotations in JSpecify mode (#1144)
Previously, we neglected to acknowledge explicit `@Nullable` return
types and `@NonNull` parameter types in `@NullUnmarked` code unless the
`AcknowledgeRestrictiveAnnotations` setting was passed. But, the
JSpecify spec requires acknowledging restrictive annotations in
`@NullUnmarked` code. So now, in JSpecify mode, we always acknowledge
restrictive annotations.
Note that in JSpecify mode, this change will also impact handling of
other "unannotated" code that is not explicitly annotated
`@NullUnmarked`. But, as discussed in #978, we want to switch to
acknowledging restrictive annotations by default anyway. It seems
reasonable to go ahead and make this change in JSpecify mode, to ensure
greater spec compliance.1 parent 7fa7bf9 commit a1df1c4
File tree
2 files changed
+67
-1
lines changed- nullaway/src
- main/java/com/uber/nullaway/handlers
- test/java/com/uber/nullaway/jspecify
2 files changed
+67
-1
lines changedLines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
Lines changed: 62 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
869 | 931 | | |
870 | 932 | | |
871 | 933 | | |
| |||
0 commit comments