When a finally block is executed after an exception is thrown, breakpoints submitted in the finally block are never hit.
This is reproducible in JDK 1.7, JDK 1.8 and JDK 1.9.
To reproduce:
1) Create a folder 'test' and put the attached file into it.
2) javac test/NewClass.java
3) jdb test/NewClass
> stop at test.NewClass:18
> run
4) We'd expect that the breakpoint is hit and the program is suspended at line 18.
But this is not the case. The code in the finally block is executed, ignoring the breakpoint, because both messages are printed out:
Finally1
Finally2
Program is suspended on the very end of the finally block, because of the exception.
This is reproducible in JDK 1.7, JDK 1.8 and JDK 1.9.
To reproduce:
1) Create a folder 'test' and put the attached file into it.
2) javac test/NewClass.java
3) jdb test/NewClass
> stop at test.NewClass:18
> run
4) We'd expect that the breakpoint is hit and the program is suspended at line 18.
But this is not the case. The code in the finally block is executed, ignoring the breakpoint, because both messages are printed out:
Finally1
Finally2
Program is suspended on the very end of the finally block, because of the exception.