Commit cb72c5a
authored
Support java.util.Objects.toString() (#1283)
Add support for java.util.Objects.toString(). Closes #1282
When passing `null` as a nullDefault String, the Object is not
guaranteed nonNull.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved nullability analysis for java.util.Objects.toString(Object,
String). The return value is now considered nullable when the default
string argument may be null, preventing unsafe dereferences. Calls with
a non-null default string remain treated as non-null.
* **Tests**
* Added a test validating the updated behavior for Objects.toString with
both non-null and null default string arguments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: gulikoza <[email protected]>1 parent 8f40500 commit cb72c5a
2 files changed
Lines changed: 21 additions & 0 deletions
File tree
- nullaway/src
- main/java/com/uber/nullaway/handlers
- test/java/com/uber/nullaway
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
812 | 812 | | |
813 | 813 | | |
814 | 814 | | |
| 815 | + | |
815 | 816 | | |
816 | 817 | | |
817 | 818 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1154 | 1154 | | |
1155 | 1155 | | |
1156 | 1156 | | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
1157 | 1177 | | |
1158 | 1178 | | |
1159 | 1179 | | |
| |||
0 commit comments