I've got the following interface:
public interface FooFactory {
Foo create();
default Foo createWithData(Data data){
Foo foo = create();
foo.addData(data);
return foo;
}
}
install(new FactoryModuleBuilder().build(FooFactory.class));
create()
the guice-assistedinject
module has a bug for skipping the java-8 default method at line L252. and I found there is no tests to testing this feature.
a default method is neither a bridge
method nor a synthetic
method at all in java complier. However, its comments says that will skips the default methods. and the code should be as:
if (isDefault(method)){
...
}
you need to write your own Provider
instead.