dagger
dagger copied to clipboard
Warning when using qualifier annotations with AutoFactory
When using AutoFactory with qualifier annotations like this
@AutoFactory
public class MyClass {
public MyClass(int param, @Provided @QualifierA Object param2) {
}
}
Dagger will issue the following warning:
Dagger will ignore qualifier annotations on parameters that are not @Inject constructor parameters or @Provides method parameters: param2
This is a kind of useless because in this case, the generated factory class will use the annotation correctly. Also there is no way to hide the warning (unless there is one, in which case please tell me).
Hmm. There should be a @SuppressWarning on that.
On 25 June 2014 06:55, cypressious [email protected] wrote:
When using AutoFactory with qualifier annotations like this
@AutoFactorypublic class MyClass { public MyClass(int param, @Provided @QualifierA Object param2) { }}
Dagger will issue the following warning:
Dagger will ignore qualifier annotations on parameters that are not @Inject constructor parameters or @Provides method parameters: param2
This is a kind of useless because in this case, the generated factory class will use the annotation correctly. Also there is no way to hide the warning (unless there is one, in which case please tell me).
— Reply to this email directly or view it on GitHub https://github.com/square/dagger/issues/419.
At least Eclipse didn't offer one. What's the parameter?
Eclipse might not know about it - it might not exist, but even if it did, if it's in the annotation processor, there's no information for eclipse to access to know about it. I'll dig in. What I will say is that if we preserve this warning in Dagger 2, there for sure will be a suppression option.
On 25 June 2014 10:41, cypressious [email protected] wrote:
At least Eclipse didn't offer one. What's the parameter?
— Reply to this email directly or view it on GitHub https://github.com/square/dagger/issues/419#issuecomment-47134363.
Nice, thank you.