Handling of undeclared checked exceptions
When thinking about conversion issues in a planned Java extension, the following question came up, where I could not find information about. Maybe you can tell me:
If bytecode is created for a method (by a compiler extension) not declaring any exceptions, and within this bytecode a method is called that throws checked exceptions, will the virtual machine complain or forward those exception?
# 1
You can test this and you don't need anything special to do it.
Steps
1. Class A and B. Methd B.doit() throws unchecked exception. A.doit2() calls B.doit()
2. Modify B.doit() to throw a checked exception.
3. Compile only B.
4. Run A and see what happens.
I suspect checked exceptions are a compile time problem, not runtime. But that is just a guess. You could read the verification sections of the VM/Lang to find out specifically what it should do.