Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-9199

Code in finally block is ignored in IntelliJ IDEA debugger

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.7
    • Fix Version/s: 2.5.8, 3.0.0-beta-3
    • Component/s: bytecode
    • Labels:
      None

      Description

      A single line of code in a finally block is ignored. Given then following example code

      class Example {
          static void t(boolean t) {
              if (t) {
                  throw new RuntimeException();
              }
          }
      
          static void example() {
              try {
                  t(true)   // <- break point here!
              } finally {
                  t(false)
              }
          }
      
          static void main(String[] args) {
              example()
          }
      }
      
      

      When you run this code in the IntelliJ IDEA debugger makes the t(false) appears as it's not executed. The line numbers are misleading.

      Code works in 2.5.4 but it's broken since 2.5.5. Please see attached bytecode dumps.

       

      Problem identified by Mandrikov Evgeny Andreevich (JaCoCo). Observed and reported at JCrete 2019 hackfest.

        Attachments

        1. example_2_5_4.txt
          24 kB
          Andres Almiray
        2. example_2_5_7.txt
          24 kB
          Andres Almiray

          Issue Links

            Activity

              People

              • Assignee:
                paulk Paul King
                Reporter:
                aalmiray Andres Almiray
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m