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

NPE in unboxInteger

XMLWordPrintable

    • b17
    • generic
    • generic
    • Verified

        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]);

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

                Created:
                Updated:
                Resolved: