remove confusing behavior from assistedinject -- it used to allow factory creations to be resolved by the injector if the return key matched something in the injector.  now it always creates new objects.  the prior behavior created a scenario where, if the following pseudo-code was used...

    public class Bar { ... }
    interface BarFactory {  Bar createBar(...); }
    ...
    protected void configure() {
          // allow custom Bars to be created if using BarFactory
          install(new FactoryModuleBuilder().build(BarFactory.class));
    }
    @Provides Bar defaultBar() {  // allow a default value
         return new Bar(...);
    }

...Someone wants to allow default Bars to be injected AND create custom ones if using BarFactory.  But, AssistedInject didn't actually do that.  When someone called BarFactory.create(...), it returned the bar created from the @Provides method, because AssistedInject saw the main injector had a binding for Bar.

This removes that behavior, so AssistedInject will always create a new Bar when its factory method is called.

git-svn-id: https://google-guice.googlecode.com/svn/trunk@1189 d779f126-a31b-0410-b53b-1d3aecad763e
3 files changed