I have a class that needs to inject a deprecated class. It looks like this:
public class Foo {
@Inject
@SuppressWarnings("deprecation")
Foo(DeprecatedClass foo) {
}
}
The generated Foo_Factory doesn't add the @SuppressWarning for "deprecation":
@ScopeMetadata
@QualifierMetadata
@DaggerGenerated
@Generated(
value = "dagger.internal.codegen.ComponentProcessor",
comments = "https://dagger.dev"
)
@SuppressWarnings({
"unchecked",
"rawtypes",
"KotlinInternal",
"KotlinInternalInJava",
"cast"
})
public final class Foo_Factory implements Factory<Foo> {
private final Provider<DeprecatedClass> fooProvider;
public Foo_Factory(Provider<DeprecatedClass> fooProvider) {
this.fooProvider = fooProvider;
}
// ...
This prevents me to run java with -Werror active. I found that this feature exist on Hilt for other cases or at least that's what I understand from #2834.
Something similar happens when the deprecated class has the @Inject. The Factory also contains warning. Example:
@Deprecated("Don't use, please")
class DeprecatedClass @Inject constructor()
I found out this last one while writing this snippets for this issue so I don't care that much about it. And I'm not sure if it should be tracked in this issue or open a new one.
I have a class that needs to inject a deprecated class. It looks like this:
The generated
Foo_Factorydoesn't add the@SuppressWarningfor"deprecation":This prevents me to run java with
-Werroractive. I found that this feature exist on Hilt for other cases or at least that's what I understand from #2834.Something similar happens when the deprecated class has the
@Inject. The Factory also contains warning. Example:I found out this last one while writing this snippets for this issue so I don't care that much about it. And I'm not sure if it should be tracked in this issue or open a new one.