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

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

XMLWordPrintable

    • b78
    • Verified

        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

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

                Created:
                Updated:
                Resolved: