google-code-export / gwt-test-utils

Automatically exported from code.google.com/p/gwt-test-utils
1 stars 0 forks source link

Gin support attempts to bind a Provider, and Guice complains (rightfully so). #104

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
To reproduce this bug, add the following code to the GInjectorCreateHandlerTest:

static class ImplementationWithProviders implements Virtual {
  @Inject
  public ImplementationWithProviders(Provider<VirtualMore> provider) {}
}

static class M4 extends AbstractGinModule {
  @Override
  protected void configure() {
    bind (Virtual.class).to(ImplementationWithProviders.class);
    bind (VirtualMore.class).to(ImplMore2.class);
  }
}

@GinModules(M4.class)
interface G4 extends Ginjector {
  Virtual v();
}

/**
 * This is the use case that needs to hold.
 * <code><pre>
 * class Animal {
 *   @Inject
 *   Animal (Provider<Sound> soundProvider) {
 *   }
 * }
 * </pre></code>
 */
@SuppressWarnings("unused")
@Test
public void shouldInstantiateObjectGraphsContainingProviders() {
  final G4 injector = GWT.create(G4.class);
  final Virtual virtual = injector.v();
}

I'm not sure where the bug goes to surface, but I'll try to add a fix later.

Original issue reported on code.google.com by alex.dob...@gmail.com on 2 Jan 2012 at 10:27

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 3 Jan 2012 at 7:06

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The submitted patch 
(http://code.google.com/p/gwt-test-utils/issues/detail?id=105) has been applied 
on lastest 0.36-SNAPSHOT, 0.33.2-SNAPSHOT, 0.28.9-SNAPSHOT, 0.25.6-SNAPSHOT and 
0.22.6-SNAPSHOT.

Original comment by gael.laz...@gmail.com on 14 Feb 2012 at 10:00