Add logging for when AssistedInject falls into non-optimized mode, so people can take action and fix it.
An @Assisted Provider in a class param:
WARNING: AssistedInject factory com.google.inject.assistedinject.FactoryProvider2Test$ColoredCarFactory will be slow because class com.google.inject.assistedinject.FactoryProvider2Test$Subaru has Assisted Provider dependencies or injects the Injector. Stop injecting Assisted Provider<T> (instead use Assisted T) or Injector to speed things up. (It will be a ~6500% speed bump!) The exact offending deps are: [Key[type=com.google.inject.Provider<com.google.inject.assistedinject.FactoryProvider2Test$Color>, annotation=@com.google.inject.assistedinject.Assisted(value=)]@com.google.inject.assistedinject.FactoryProvider2Test$Subaru.colorProvider]
The injector in class param:
WARNING: AssistedInject factory com.google.inject.assistedinject.FactoryProvider2Test$ColoredCarFactory will be slow because class com.google.inject.assistedinject.FactoryProvider2Test$Segway has Assisted Provider dependencies or injects the Injector. Stop injecting Assisted Provider<T> (instead use Assisted T) or Injector to speed things up. (It will be a ~6500% speed bump!) The exact offending deps are: [Key[type=com.google.inject.Injector, annotation=[none]]@com.google.inject.assistedinject.FactoryProvider2Test$Segway.injector]
An @Assisted Provider in a constructor arg:
WARNING: AssistedInject factory com.google.inject.assistedinject.FactoryProvider2Test$ColoredCarFactory will be slow because class com.google.inject.assistedinject.FactoryProvider2Test$Flamingbird has Assisted Provider dependencies or injects the Injector. Stop injecting Assisted Provider<T> (instead use Assisted T) or Injector to speed things up. (It will be a ~6500% speed bump!) The exact offending deps are: [Key[type=com.google.inject.Provider<com.google.inject.assistedinject.FactoryProvider2Test$Color>, annotation=@com.google.inject.assistedinject.Assisted(value=)]@com.google.inject.assistedinject.FactoryProvider2Test$Flamingbird.<init>()[1]]
----------------
Manually Synced.
COMMIT=45725763
1 file changed