Lombok misses field's annotation while auto generating constructor. Is there a way to retain field's annotation in constructor input params?
Class to generate constructor,
@RequiredArgsConstructor(onConstructor = @__(@Inject))
public class Test {
@Named("MyField")
private final String field;
@Named("MyHandler")
private final SomeHandler handler;
}
Generated class :
public class Test {
@Named("MyField")
private final String field;
@Named("MyField")
private final SomeHandler handler;
@Inject
public Test(final String field, final SomeHandler handler) {
this.field = field;
this.handler = handler;
}
}
Desired class :
public class Test {
@Named("MyField")
private final String field;
@Named("MyHandler")
private final SomeHandler handler;
@Inject
public Test(@Named("MyField")final String field,
@Named("MyHandler")final SomeHandler handler) {
this.field = field;
this.handler = handler;
}
}