unreachable catch blocks are not detected

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.3.0
    • Component/s: tools
    • generic
    • generic

      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;
      }
          }
      }

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: