Closed nimakarimipour closed 1 year ago
@msridhar @lazaroclapp I noticed a problem in a followup PR for this PR and updated this one. Would you please take a look at the changes.
The plan for remaining error suppression is as below:
@NullUnmarked
on the containing method where the error is reported except for initialization errors.SuppressWarings("NullAway.Init")
for initialization errors on the field not on the constructors.SuppressWarings("NullAway")
for errors in the initializer expression for fields on the initialized field except for passing nullable as parameters.@NullUnmarked
.NullUnmarked
at the class level for errors in the static initialization blocksNullUnmarked
at the class level if the error is still unresolved after step 1 to 4.Prior to the changes I made recently, we were adding @NullUnmarked
on the constructors for uninitialized fields. The latest changes also conforms to version 1.3.6-alpha-5
.
@msridhar @lazaroclapp Please find the update test case here 5f25f1b66e08ea568e9e03f17a53fc79cbe39516. This unit test with this change would have been failed without changes in this PR.
@msridhar @lazaroclapp Thank you very much for the review. I will land this now. We can continue the discussion in #137
This PR fixes a bug which was causing annotator to only inject
@NullUnmarked
annotations on methods. This PR fixes this issue and enables Annotator to add@NullUnmarked
annotation for errors enclosed by constructors.