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

Autoconversion SAM adapters sometimes don't get privileges

    XMLWordPrintable

Details

    • b112
    • generic
    • generic

    Description

      Nashorn converts JS functions to SAM types automatically when passing to Java methods. SAM adapter converters normally use adapters defined in the protection domain of the scripts calling them. The calling script's class is available as internal Dynalink information in context of a linking operation. In certain circumstances, when conversion operations are executed at invocation time instead of link time however, the calling script information is not available, and such SAM adapters are then conservatively created with a no-permission domain.

      These circumstances include:
      - explicit invocation of Java.to with a target array type that has a SAM type as its component
      - invocation of Java methods with invocation time (instead of link time) dispatch: setters with dynamic name and some overloaded methods.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: