Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8134653

Breakpoints do not work in finally blocks in case of exceptions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P3 P3
    • 9
    • None
    • core-svc
    • None
    • generic
    • generic

      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.

            dsamersoff Dmitriy Samersoff
            mentlich Martin Entlicher
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: