Provide exception table sorting functionality
Currently without writing a custom adapter it is impossible to correctly nest
an exception handler within a pre-existing handler. The ClassReader visits the
existing try/catch blocks before any of the method code is visited, and the
MethodWriter writes the exception table in the order it receives the try/catch
visits. Without caching the try/catch visits it is therefore impossible to
insert a nested handler as it would need to precede some or all of the existing
handlers in the table.
I propose either:
A) Including an adapter that caches and sorts the try/catch visits in the
org.objectweb.asm.commons package.
B) Modifying the MethodWriter to correctly sort the handlers before writing the
table on the toByteArray call.