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

Add a missing member handler to BeansLinker

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • None
    • 9
    • core-libs
    • None

      BeansLinker is ordinarily near the bottom of the linker chain, and currently it has a hard-wired behavior for linking variable-named getters on non-existent properties: return null. (It also has a hard-wired behavior for linking linking variable-named getters on non-existent properties: do nothing.)

      Nashorn, as well as other languages, could benefit from providing configurable behavior for this situation. Nashorn specifically could finally resolve JDK-8057173.

      We basically need a constructor for beans linker that takes something that can create handlers for "no such member" on demand; a (linkRequest, linkerServices)->methodHandle function. Note that this looks very similar to GuardingDynamicLinker, which is a (linkRequest, linkerServices)->guardedInvocation. It is deliberate that this should only return a methodHandle as BeansLinker internally deals with "guarded invocation components", which are more generic than method handles but less generic than guarded invocations. If we don't want to expose that whole machinery in the API, we can only use a function that returns a method handle.

        1. noSuchMember
          24 kB
        2. noSuchMember2
          67 kB
        3. noSuchMember2
          63 kB

            attila Attila Szegedi
            attila Attila Szegedi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: