error-prone icon indicating copy to clipboard operation
error-prone copied to clipboard

`UnnecessaryQualifier` outputs warnings for qualifier annotations copied by lombok

Open facboy opened this issue 5 months ago • 1 comments

Not sure if this is feasible to address, but e.g. with lombok you can do

@RequiredArgsConstructor
class MyClass {

   @SpecialString final String injectedString;
}

and configure it to copy @SpecialString to the generated constructor's parameter. at the moment errorprone is warning about the qualifier on the injected field, but there's nowhere else to put it in lombok land.

facboy avatar Jul 01 '25 11:07 facboy

Another example:

@RequiredArgsConstructor(onConstructor_ = @Inject, access = AccessLevel.PROTECTED)
public final class FooDeleter
{
    @Deleted
    private final Event<Foo> fooDeletedEvent;

    public void delete(int connectionId)
    {
        // ...
    }
}

bannmann avatar Jul 23 '25 09:07 bannmann