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

when can a statement complete normally? (break&continue versus finally)

XMLWordPrintable

    • mantis
    • generic
    • solaris_8

      After discussion with Gilad Bracha on spec bug 4642762, he has expressed
      his intent to support the jikes/jacks interpretation of this issue.
      A break does not exit the labelled statement if an intervening finally
      clause cannot complete normally. The following code fragment is required
      to be an error.

              int i;
              a: try {
                  break a;
              } finally {
                  return;
              }
              i = 12; // reachable?

            gafter Neal Gafter (Inactive)
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: