Closed nimakarimipour closed 1 year ago
Good catch. I think the essence of the issue here is that lambdas (and method references) implicitly create an overriding method, which could have new errors when annotations are added to the functional interface method. To account for this conservatively, we make the containing method of the lambda an impacted region.
@nimakarimipour is this ready for another review?
@msridhar Yes it is now.
This pull request extends the set of impacted regions for changes made to methods. Prior to this pull request, only call sites (and overriding methods) were taken into consideration as impacted regions for changes to methods. However, the use of lambda expressions or method references can actually extend the set of impacted regions and these should also be included. See example below:
For example, if the
o
parameter of thebar
method inFoo
is annotated as@Nullable
, the regionsbaz2
andbaz3
were previously not included as impacted regions since there is no trace of bar in these methods in the current implementation. As a result, the triggered errors (such aspassing @Nullable for t(Object)
) will not be caught by the annotator. This pull request addresses this issue and extends the set of impacted regions to includebaz2()
andbaz3()
for changes made toFoo#bar()
.This PR also renames the output
call_graph.tsv
tomethod_impacted_region_map.tsv
to better reflect its new content as it is no longer limited to just call sites, but now also includes the additional regions.