ucr-riple / NullAwayAnnotator

A tool to help adapting code bases to NullAway type system.
MIT License
13 stars 6 forks source link

Add Context to Annotator data structures #175

Closed nimakarimipour closed 1 year ago

nimakarimipour commented 1 year ago

The annotator-core module contains two classes, FieldRegistry andMethodRegistry, that store structural information about the processing module. Many methods in this module require instances of these classes as arguments, which can lead to complex code. To simplify the architecture, this PR introduces the Context class that encapsulates both FieldRegistry and MethodRegistry in ModuleInfo instance. With this update, most method signatures will be changed to foo(Context context), where each method can access the relevant information from the context.

Although this PR is quite extensive, its main objective is to introduce just the Context class with no unrelated changes. If you agree with the proposed change outlined in the PR description and don't feel the need for a full review, please let me know, and I can proceed with merging the PR. Thank you.