Open GoogleCodeExporter opened 9 years ago
Although I haven't analyzed it as closely, this I think this is the same issue
as described in issue 722. The problem is that your bind statement is:
bind(Intercepted.class).to(MethodIntercepted.class);
and there's no separate binding for MethodIntercepted.class. So Guice doesn't
know you want MethodIntercepted to be private, it just knows you want
Intercepted to link to whatever MethodIntercepted is. MethodIntercepted gets
promoted to the parent module, and the interceptor doesn't apply to the parent
module.
Adding bind(MethodIntercepted.class) to your PrivateModule should fix it.
Alternately, adding binder().requireExplicitBindings() to the parent Module
will tell Guice that just-in-time bindings aren't allowed, and it won't attempt
to promote MethodIntercepted to the parent module.
Original comment by sberlin
on 2 Aug 2012 at 1:30
Original issue reported on code.google.com by
djwh...@google.com
on 3 May 2012 at 11:47