Annotator mistakenly adds a duplicate @Nullable annotation to a field that already has a @Nullable annotation with a comment.
Steps to Reproduce
Consider the following code snippet:
class Test {
@Nullable @GuardedBy("this") // Either a RuntimeException, non-fatal Error, or IOException.
private Throwable creationFailure;
}
When Annotator attempts to ensure the creationFailure field is nullable, it fails to recognize that the field is already annotated as @Nullable.
The resulting output incorrectly adds a duplicate annotation:
class Test {
@Nullable @Nullable @GuardedBy("this") // Either a RuntimeException, non-fatal Error, or IOException.
private Throwable creationFailure;
}
This causes a compilation error, terminating the process.
Describe the Bug
Annotator mistakenly adds a duplicate
@Nullable
annotation to a field that already has a@Nullable
annotation with a comment.Steps to Reproduce
Consider the following code snippet:
When Annotator attempts to ensure the creationFailure field is nullable, it fails to recognize that the field is already annotated as
@Nullable
. The resulting output incorrectly adds a duplicate annotation:This causes a compilation error, terminating the process.