Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Not A Problem
-
2.0.4, 2.1
-
None
-
All
Description
Run the BXML Explorer Tutorial application. Open up the "org/apache/pivot/tests/alert_prompt_test.bxml" file and try to bring up any of the alerts or prompts. There will be an IllegalArgumentException that "display is null."
The stack trace (for 2.0.x) shows this:
java.lang.IllegalArgumentException: display is null.
at org.apache.pivot.wtk.Window.open(Window.java:630)
at org.apache.pivot.wtk.Dialog.open(Dialog.java:186)
at org.apache.pivot.wtk.Alert.alert(Alert.java:359)
at org.apache.pivot.wtk.Alert.alert(Alert.java:331)
at jdk.nashorn.internal.scripts.Script$3$^eval_.:program(<eval>:1)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:449)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:406)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:402)
at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155)
at javax.script.AbstractScriptEngine.eval(Unknown Source)
at org.apache.pivot.beans.BXMLSerializer$AttributeInvocationHandler.invoke(BXMLSerializer.java:156)
This sequence shows that "owner.getDisplay()" is returning null at Alert.open() time, even though the owner window is clearly visible at the time.
This could possibly be due to Nashorn scripting issues with Java 8, since the "window" variable would be set in the JS namespace, but this doesn't really explain why the "display" value is null, and not the "window" value itself.