Change Key so that it upgrades Annotation classes where all methods have default values into an instance of the Annotation with the defaults as values, so that:
  @Retention(RUNTIME)
  @BindingAnnotation @interface AllDefaults {
    int hasDefault() default 1;
  }

  @AllDefaults class Foo {}

  void testKey() {
    assertEquals(Key.get(Foo.class, Foo.class.getAnnotation(AllDefaults.class)),
                 Key.get(Foo.class, AllDefaults.class));
  }

Also adds an option to "require exact binding annotations", which disables the error-prone fallback built into Guice whereby a binding for @Named Foo can substitute for @Named("foo") Foo if the latter doesn't exist but the former does.

-----------------
Manually Synced.
COMMIT=45600016
13 files changed