Thank you for your bug report and pretty good analysis.
It is really helpful.
To avoid this problem, I propose to check null of the return value of
ConstPool#getClassInfo() (type of the exception) in the getType() method
Yes, this is a correct and quick fix. However, if your analysis is correct,
I think ExprEditor.edit(Handler) should not be called with a finally block.
(Note that Javac automatically adds a finally block for each synchronized
block. So the exception table includes a catch block or a finally
Don't you think I must modify the implementation of ExprEditor
rather than getType()? Or, do you like to hook both catch and finally
Let me know your thought. Thx.
I agree with you. Concretely, I propose the following modification.
- Change the ExprEditor#edit(Handler) method to hook only the catch block.
Moreover, I want to other methods to treat respectively the synchronized
block and finally block. So, I want you to adopt the new methods for hooking
the synchronized block and the finally block respectively.
I would prefer it if you could consider this idea.