Kanstantsin Shautsou
04/11/2024, 11:15 AM@Inject
protected ObjectFactory getObjectFactory() {
throw new UnsupportedOperationException(); // << not thrown during execution?
}
Would inject work just for ObjectFactory field ?Thomas Broyer
04/11/2024, 11:25 AMObjectFactory
and that won't call the super
method, so won't throw.
It works for a handful of services: https://docs.gradle.org/current/userguide/custom_gradle_types.html#service_injection
It's more idiomatic nowadays to make the class and method abstract @Inject
)Kanstantsin Shautsou
04/11/2024, 11:27 AMVampire
04/11/2024, 11:53 AM@Inject
@Thomas Broyer?
You still need it even when using an interface or abstract methods, don't you?Thomas Broyer
04/11/2024, 12:47 PM@Inject
, and this is documented in the link I gave above 🤦♂️
🤣