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

jdb: Incorrect stepping inside finally block

XMLWordPrintable

    • b89
    • Verified

        $ jdb Main
        Initializing jdb ...
        > stop at Main:9
        Deferring breakpoint Main:9.
        It will be set after the class is loaded.
        > run
        run Main
        Set uncaught java.lang.Throwable
        Set deferred uncaught java.lang.Throwable
        >
        VM Started: Set deferred breakpoint Main:9

        Breakpoint hit: "thread=main", Main.test(), line=9 bci=2
        9 if (args.length < - 1) { // Any non-trivial condition evaluating to `false` would do

        main[1] step
        >
        Step completed: "thread=main", Main.test(), line=10 bci=16
        10 System.out.println("not null");

        Source:
        public class Main {
          public static void main(String[] args) {
            test(args);
          }
          public static Void test(String[] args) {
            try {
              return null;
            } finally {
              if (args.length < - 1) { // Any non-trivial condition evaluating to `false` would do
                System.out.println("not null");
              }
            }
          }
        }

              aeriksso Andreas Eriksson (Inactive)
              shadowbug Shadow Bug
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: