Remove redundant complete()
call and CompletionFailure
check.
#4464
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remove redundant
complete()
call andCompletionFailure
check.Those operations are already performed during our call to
getSymbolFromString
, which returnsnull
in case of failure.(I've found the comment that I'm removing a little confusing, too: I think it might be making the point that we don't want to let the
CompletionFailure
propagate because that would fail Error Prone entirely when in fact the check that calledannotationsAmong
might find one of the other annotations it was looking for among the annotations inherited by the class? (We would already have handled any directly present annotations inannotationsAmong
as well as inhasAnnotation
.) If so, we're fine, as we handlenull
gracefully. (Of course, this assumes that silently ignoring an annotation that should have been inherited isn't a bad problem that should really lead to a crash. But there's only so much we can do in the presence of an incomplete classpath.) Or is it actually making the point that we want to try to look for@Inherited
even if completing some other part of the annotation has failed (if that is even possible) and hence we fall through instead of immediately returningfalse
? If so, that doesn't currently work because we would already have bailed after thenull
return fromgetSymbolFromString
. Anyway, whatever the comment is getting at, this CL is a no-op, so I'm just trying to avoid putting on blinders as I remove the surrounding code.)