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

DA versus switch: javac allows reference to uninitialized variable

    XMLWordPrintable

Details

    • mantis
    • generic
    • solaris_8
    • Verified

    Description

      javac allows the following code, generating a class file that does not verify.

      class T {
          public static void main(final String[] args) {
              {
                  final Object b;
                  b = null;
              }
              switch(args.length) {
              case 0:
                  int b;
                  break;
              case 1:
                  int c = b;
              }
          }
      }

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: