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

unreachable catch blocks are not detected

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • None
    • 1.3.0
    • tools
    • generic
    • generic

    Description

      The following compiles without error in both 1.2 and 1.3-L.
      According to JLS 14.19, the catch blocks are unreachable.

      public class Bug {

          void test() {

      int state = 0;
      try {
      // empty try cannot generate Exceptions !
      }
      catch (ArithmeticException e) {
      state = 1;
      }
      catch (Exception e) {
      state = 2;
      }
          }
      }

      Attachments

        Issue Links

          Activity

            People

              wmaddoxsunw William Maddox (Inactive)
              wmaddoxsunw William Maddox (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: