JDK-8038413 : NPE in unboxInteger
  • Type: Bug
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Affected Version: 8u40
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2014-03-26
  • Updated: 2015-01-21
  • Resolved: 2014-06-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u40Fixed 9 b17Fixed
Related Reports
Duplicate :  
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]);

Comments
verified on 9b25
05-08-2014

Code exists only in Nashorn staging repo at the moment
14-04-2014