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

Warn about problematic forward references

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Rejected
    • P4
    • None
    • 6
    • tools
    • generic
    • generic

    Description

      The following program compiles:

      class Test {
          static Object x = Test.x;
      }
      This is rejected by javac:

      class Test {
          static Object x = x;
      }

      Since Test.x and x represent the same variable should the compiler
      reject both programs?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ahe Peter Ahe
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: