You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should add java assertions to generated suppliers to verify that the supplier is not invoked in the binding code (i.e. @Injector constructors or provider methods on @Fragment types). It may also be able to assert that they are not invoked before the injector is initialized but it is unclear if this can be done safely in a concurrent scenario or is even reasonable to do in a concurrent scenario.
This would involve adding a flag to Injector that is set when fully initialized and then checking this flag inside supplier. To ensure this code is stripped in production builds the assignment and verification would need to be done via asserts like assert state = 1; and assert state != 0, "Supplier N invoked before component construction complete";
The text was updated successfully, but these errors were encountered:
We should add java assertions to generated suppliers to verify that the supplier is not invoked in the binding code (i.e.
@Injector
constructors or provider methods on@Fragment
types). It may also be able to assert that they are not invoked before the injector is initialized but it is unclear if this can be done safely in a concurrent scenario or is even reasonable to do in a concurrent scenario.This would involve adding a flag to Injector that is set when fully initialized and then checking this flag inside supplier. To ensure this code is stripped in production builds the assignment and verification would need to be done via asserts like
assert state = 1;
andassert state != 0, "Supplier N invoked before component construction complete";
The text was updated successfully, but these errors were encountered: