What should the following program print?

@Singleton
class B {
  static int instanceCount = 0;
  int instanceId = instanceCount++;

  public static void main(String[] args) {
    Injector injector = Guice.createInjector(Stage.PRODUCTION);
    injector.getProvider(B.class);
    System.out.println(instanceCount);
  }
}

The problem is interesting in how it relates to issue 373. We have a
bug where we're not eagerly creating singletons at child-injector-
creation when their bindings live in the parent injector.
  http://code.google.com/p/google-guice/issues/detail?id=373
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-guice-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to