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

inlined finally clauses confuse debuggers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • 7
    • tools
    • None
    • b98
    • generic
    • generic
    • Verified

      =====================================================

      Here is one that could be a bit confusing. When
      stepping, control goes from the if-statement
      directly to the finalizer without ever hitting
      the return statement.

      public class XMain {
          public static void main(String... args) {
              try {
                  boolean duh = false;
                  if (duh == true) {
                      System.out.println(duh);
                      return;
                  } else {
                      System.out.println(duh);
                      return;
                  }
              } finally {
                  System.out.println("finally");
              }
          }
      }

            vromero Vicente Arturo Romero Zaldivar
            ksrini Kumar Srinivasan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: