Currently if buildProxyClass() is used, new instances of the proxy class won't
have the handler field set, and there isn't an easy way to set it. (I imagined
the generated class would somehow be connected to the handler, probably with a
static handler field, but Jesse pointed out that this would make it impossible
to cache proxy classes.)
It seems like buildProxyClass() may not have been intended for external use, or
may have been considered experimental (the commit message says "I'm not 100%
convinced on this one yet"). But it is public and included in the latest
release, so let's make it easier to use by exposing a method to set the
invocation handler.
I also want to make it really clear in the documentation that callers of
buildProxyClass() must manually set the handler on new instances, even if a
handler() was configured (it would have no effect).
If you agree with the change, here's the commit on my clone:
https://code.google.com/r/daniel-lubarov-dexmaker/source/detail?r=7361f3db4acd18
39d166cad18fdd6b9c25bbe278
Or if it's easier, I attached a patch file.
Original issue reported on code.google.com by daniel@lubarov.com on 5 Dec 2014 at 9:13
Original issue reported on code.google.com by
daniel@lubarov.com
on 5 Dec 2014 at 9:13Attachments: