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

JLS3 14.21 Not detecting unreachable code (exit via break with intervening finally block)

XMLWordPrintable

    • rc
    • generic
    • solaris_2.5.1
    • Verified

      The following code does NOT cause a "statement not reached error":

      class x {
          void f(){
              int i =0;
              while ( true) {
                  try{break;}
                  finally{return;}
              }
              i++;
          }
      }

      Yet, if you remove the "break;", it does. The i++ statement is unreachable
      in either case and should be diagnosed as such.

      -kto
      ###@###.### 10/22/04 14:12 GMT

            abuckley Alex Buckley
            ohair Kelly Ohair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: