99soft/lifegycle — pull request #5 by binkley (2013-10-28 10:44:30+00:00)
Title: Demonstrate and fix a bug with JDK proxies.

Apologies for import reordering!

I found and fixed a subtle bug with AbstractMethodTypeListener. JDK proxies come in two flavors:

# Proxies of private interfaces adopt the package they are in (or that of their enclosing scope if an inner class)
# Proxies of public interfaces get a magical package depending on JDK implementation, and getPackage() returns null for their class

The second type throws an NPE in hear() from a method invocation chain which includes getPackage(). The fix was trivial, and I included a test case.

See http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Proxy.html.