ucr-riple / NullAwayAnnotator

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

Update Scanner to serialize methods annotations on return type #196

Closed nimakarimipour closed 1 year ago

nimakarimipour commented 1 year ago

This method update Scanner to serialize all methods annotations on return type. (Will be used in the upcoming PR (#201) to enhance Lombok support).

Previous to this PR MethodRecords contained a flag denoting if the method is marked with @Nullable, with this new implementation, that flag is removed and replaced with full set of annotations.

Method's annotations on return type are serialized on their corresponding column in method_records.tsv file. Only annotations types are serialized and are separated by comma.

Please see example below:

class Foo {
@SuppressWarnings({"A", "B"})
@Override
@lombok.Genereted
Object getBar() { ... }

Scanner will serialize:

java.lang.SuppressWarnings,java.lang.Override,lombok.Generated