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

NPE in unboxInteger

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 8u40
    • Fix Version/s: 9
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      b17
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        The following test case (from buffer.js in avatar.js) throws an NPE

        Exception in thread "main" java.lang.NullPointerException
        at sun.invoke.util.ValueConversions.unboxInteger(ValueConversions.java:77)
        at jdk.nashorn.internal.scripts.Script$Recompilation$4$restOf$buffer.:program(buffer.js:6)
        at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:539)
        at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:218)
        at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:376)
        at jdk.nashorn.tools.Shell.apply(Shell.java:386)
        at jdk.nashorn.tools.Shell.runScripts(Shell.java:315)
        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)


        function write() {
          charsWrittenReturn[0] = 42;
        }

        var charsWrittenReturn = java.lang.reflect.Array.newInstance(java.lang.Integer.class, 1);
        print(charsWrittenReturn[0]);

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                attila Attila Szegedi
                Reporter:
                akhil Akhil Arora (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: