I have the following piece of code:
void func()
{
try
{
f1()
}
finally()
{
if (resource != null)
resource.close();
}
}
I put three breakpoints: call to f1(), inside f1(), on the if statement in the finally block.
It appears that the breakpoint in finally block is not being hit. If after hitting the breakpoint inside f1() I step using the next command, I indeed end up going through the finally block.
Also If I put breakpoints on both the lines of the finally block, the breakpoint is indeed hit for the first one.
Not sure if this is due to a bug in JDB. Can someone tell me if this is a known issue or if I am missing something?
I am using JDK 6 on Linux.