ucr-riple / NullAwayAnnotator

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

Add support for type use annotation injection #187

Closed nimakarimipour closed 1 year ago

nimakarimipour commented 1 year ago

This PR is built upon #184 #184 is landed


This PR enables Annotator to inject/remove type use annotation.

On type-use annotation addition, injector inserts the annotation on the types name:

java.util.List<String> list;

Will be:

java.util.@Nullable List<String> list;

Also, our current implementation, will add the annotation on all type arguments on the declaration as well: Final output is:

java.util.@Nullable List<@Nullable String> list;

Within this PR the support for type-use annotation is added including both addition and deletion.

On deletion for expression:

java.util.@Nullable Map<@Nullable String, java.lang.@Nullable String> list;

Should be:

java.util.Map<String, java.lang.String> list;
nimakarimipour commented 1 year ago

@msridhar Thank you for the review, this is ready for another round.