@Inject
detected on a final field JAVA-W1071@javax.inject.Inject
should not be used on final fields.
JSR-330 forbids the use of @Inject
on final
fields. Many popular libraries such as Guice have adopted the convention and
disallowed @Inject on final fields.
It's highly encouraged to write code that follows this convention.
import @javax.inject.Inject;
public class Klass {
@Inject
private final String name;
}
Just remove @Inject
from final
fields.
public class Klass {
private final String name;
}