Skip to content

Conversation

@binkley
Copy link

@binkley binkley commented Oct 28, 2013

Apologies for import reordering!

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

  1. Proxies of private interfaces adopt the package they are in (or that of their enclosing scope if an inner class)
  2. 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.

@binkley
Copy link
Author

binkley commented Jan 5, 2014

This also applies to top-level classes (no package).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant