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

javac doesn't recognize unrecheable code in try ... catch statments

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.3.0
    • tools
    • None
    • sparc
    • solaris_7

      Compilation of the following examples successfuly complete, but error message expected.

      class X {
         void check_unreachable () {
            try {
            } catch(Exception e) {
               int i = 10; // error: statement not reached
            }
         }
      }

      class X {
         static void check_unreachable () {
            try {
               return;
            } catch(Error e) {} // error: statement not reached
         }
      }

      This behavior violates JLS 14.19

      konstantin.boudnik@eng 2000-02-17

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: