Closed msridhar closed 6 months ago
Attention: Patch coverage is 96.51163%
with 3 lines
in your changes are missing coverage. Please review.
Project coverage is 87.13%. Comparing base (
ce892d7
) to head (3d985b7
).
Files | Patch % | Lines |
---|---|---|
...nullaway/handlers/StreamNullabilityPropagator.java | 95.16% | 0 Missing and 3 partials :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@lazaroclapp this is ready for another look. I added support for a couple more collector factory methods based on feedback in https://github.com/uber/NullAway/issues/934#issuecomment-2017282256. This required some generalization, as we couldn't support multiple factory methods for a single collect method before; see d317d0e and c6ac215. But the overall logical structure is the same.
Fixes #934
The key new thing with the support here is we have further nesting. Rather than a
map
method, where the relevant lambda is passed directly:In this case we have a
collect
call, which gets as its argument the result ofCollectors.toMap
, and the relevant lambdas are passed totoMap
:Supporting this requires some new types of logic in our streams handler (particularly because there are multiple relevant lambdas for a single
collect
call). We do also handle anonymous inner classes. I only added support for collecting intotoMap
for now; I'm not sure if there are other important cases.I did a couple drive-by refactorings in this PR as I couldn't help it. I can undo them if they really make review more difficult, but I hope it's ok.