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

Running uncompilable scripts throws NullPointerException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b19
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        Fix for JDK-8046014 removes the null-check for the script class in Context.getProgramFunction(), causing a NullPointerException down the line for scripts that fail to compile:

        Exception in thread "main" java.lang.NullPointerException
        at java.lang.invoke.MethodHandles$Lookup.checkSymbolicClass(MethodHandles.java:1390)
        at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1373)
        at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:774)
        at jdk.nashorn.internal.runtime.Context.getCreateProgramFunctionHandle(Context.java:1025)
        at jdk.nashorn.internal.runtime.Context.getProgramFunction(Context.java:1020)
        at jdk.nashorn.internal.runtime.Context.compileScript(Context.java:1042)
        at jdk.nashorn.internal.runtime.Context.compileScript(Context.java:520)
        at jdk.nashorn.tools.Shell.runScripts(Shell.java:314)
        at jdk.nashorn.tools.Shell.run(Shell.java:169)
        at jdk.nashorn.tools.Shell.main(Shell.java:133)
        at jdk.nashorn.tools.Shell.main(Shell.java:112)

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                hannesw Hannes Wallnoefer
                Reporter:
                hannesw Hannes Wallnoefer
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: