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

Sanitize CodeInstaller and Compiler API

XMLWordPrintable

    • b82
    • generic
    • generic

        Nashorn's CodeInstaller API has few problems:
        - the type parameter <T> is unnecessary, as we only have one specialization for <ScriptEnvironment>
        - accordingly, "T getOwner()" should be changed to "ScriptEnvironment getScriptEnvironment()". Better yet, "Context getContext()"

        Nashorn's Compiler constructors are horrendous and it's not entirely clear which one is for what purpose. This could be somewhat remedied by:
        - replacing them with static factory methods with descriptive names, and
        - when CodeInstaller is passed, neither Context, ScriptEnvironment, nor ErrorManager need to be passed as they can all be reached through the CodeInstaller if we have the above proposed CodeInstaller.getContext(). In some cases (eval implementation), ErrorManager should still be passed as something other than Context.errMan is used.

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

                Created:
                Updated:
                Resolved: