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

missing DA error in anonymous ctor

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.4.2
    • Component/s: tools
    • Subcomponent:
    • Resolved In Build:
      mantis
    • CPU:
      generic
    • OS:
      solaris_8

      Description

      The following is required to be an error because x is not
      definitely assigned where used.


      class T {
          final int x;
          final Object o = new Object() {
                  int y = x; // error: x not DA
              };
          {
              x = 12;
          }
      }

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: