Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove redundant
complete()
call and CompletionFailure
check.
Those operations are already [performed during our call to `getSymbolFromString`](https://github.com/google/error-prone/blob/03d15b56478a40534b2b104e21d070d0eebc0701/check_api/src/main/java/com/google/errorprone/VisitorState.java#L432), which returns `null` 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 called `annotationsAmong` 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 in `annotationsAmong` as well as in `hasAnnotation`.) If so, we're fine, as we handle `null` 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 returning `false`? If so, that doesn't currently work because we would already have bailed after the `null` return from `getSymbolFromString`. 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.) PiperOrigin-RevId: 651828339
- Loading branch information