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

javac is accepting a self-referencing variable initializer inside a lambda expression

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b78
    • Verification:
      Verified

      Backports

        Description

        This test case:

        class Tmp
        {
            final FunctionalInterface notInitialized = ()-> {
                    FunctionalInterface simpleVariable = () -> notInitialized.foo();
            };
        }

        interface FunctionalInterface {
            void foo();
        }

        should be rejected by javac as notInitialized is being used in the initializer

        reported by Ella Nekipelova

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                vromero Vicente Arturo Romero Zaldivar
                Reporter:
                vromero Vicente Arturo Romero Zaldivar
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: