Commit 291abc5
authored
Optimize methods that check for annotations on a Symbol (#1362)
These methods are called very frequently. Previously these methods
operated on `Stream`s, but that was causing overhead visible in
profiles. Switch them to use `Iterator`s and a callback `Predicate`.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Refactor**
* Consolidated annotation-checking logic by introducing a centralized
utility method to streamline multiple annotation-matching operations
into a single, reusable component.
* Replaced stream-based checks with explicit iteration for improved
performance and code consistency across annotation-checking operations.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent e4999a6 commit 291abc5
File tree
2 files changed
+52
-13
lines changed- nullaway/src/main/java/com/uber/nullaway
2 files changed
+52
-13
lines changedLines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
194 | 226 | | |
195 | 227 | | |
196 | 228 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
80 | 75 | | |
81 | 76 | | |
82 | 77 | | |
| |||
219 | 214 | | |
220 | 215 | | |
221 | 216 | | |
222 | | - | |
| 217 | + | |
| 218 | + | |
223 | 219 | | |
224 | 220 | | |
225 | 221 | | |
| |||
230 | 226 | | |
231 | 227 | | |
232 | 228 | | |
233 | | - | |
| 229 | + | |
| 230 | + | |
234 | 231 | | |
235 | 232 | | |
236 | 233 | | |
| |||
316 | 313 | | |
317 | 314 | | |
318 | 315 | | |
319 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
320 | 322 | | |
321 | 323 | | |
322 | 324 | | |
323 | 325 | | |
324 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
325 | 332 | | |
326 | 333 | | |
0 commit comments