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

Running uncompilable scripts throws NullPointerException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • None
    • core-libs
    • None
    • b19
    • generic
    • generic

        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)

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

                Created:
                Updated:
                Resolved: