有人使用过带有Dagger2的Lombok 1.16吗?
我的当前代码如下:
@AllArgsConstructor(onConstructor = @__(@Inject))
public class JuiceMaker {
private final Apple apple;
错误为:
JuiceMaker cannot be provided without an @Inject constructor or from an @Provides-annotated method.
没有 Lombok 的注释,这实际上是有效的,所以:
public class JuiceMaker {
private final Apple apple;
@Inject
public JuiceMaker(Apple apple){
this.apple = apple
}
}
工作
@RequiredArgsConstructor(onConstructor = @__(@Inject))
时,它就无法工作了。 - Andrew Rose