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

NoClassDefFoundError when lambda is in a hidden class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 23
    • None
    • core-libs
    • None

      Current implementation of `LambdaMetafactory` does not allow to use lambdas in hidden classes. Invocation throws `NoClassDefFoundError` instead.

      `j/l/i/defineHiddenClass/BasicTest::testLambda` should cover this use case, however it references a publicly available method handle instead of a hidden lambda implementation method.

      When `j/l/i/defineHiddenClass/src/Lambda` is modified from `Object::toString;` to `o -> o.toString();` the test fails with `NoClassDefFoundError`.

            asotona Adam Sotona
            asotona Adam Sotona
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: