Annotations in general do work for local variables, although this is specified on a per-annotation basis.
If I remember correctly, for example, the @NotNull annotation in javax.validation.constraints cannot be used for a local variable, but the one provided by the checkerframework can.