ObservableValue Stacktrace
Martin Sladecek
martin.sladecek at oracle.com
Thu Jun 6 00:34:38 PDT 2013
JavaFX should not fail in these cases, but doesn't consider that a valid
state, so it always prints a warning on the stderr, for the developer to
see something went wrong.
Regards,
-Martin
On 5.6.2013 21:38, John Hendrikx wrote:
> Hi List,
>
> I'm getting some log messages sometimes (see at the end) about
> properties being null (whereas I didn't get them before in JavaFX 2.2).
>
> Is this intended as an informative message to the developer, something
> I should report, or just debug code for the JavaFX team?
>
> In this case, the binding is null, and that's fine -- it will be
> populated later, but the binding is already in place -- I thought
> JavaFX was designed to allow nulls in a chain of bindings and
> fall back to reasonable defaults for things like Strings, numbers
> etc? Am I doing something wrong?
>
> Code:
> {
> private final ObjectProperty<Media> data = new
> SimpleObjectProperty<>();
> public ObjectProperty<Media> dataProperty() { return data; }
>
> protected final ObjectBinding<ObservableList<Casting>> castings =
> Bindings.select(dataProperty(), "castings");
> }
>
> Log:
>
> Jun 05, 2013 9:15:55 PM
> com.sun.javafx.binding.SelectBinding$SelectBindingHelper
> getObservableValue
> WARNING: Exception while evaluating select-binding [castings]
> Jun 05, 2013 9:15:55 PM
> com.sun.javafx.binding.SelectBinding$SelectBindingHelper
> getObservableValue
> WARNING: Property 'castings' in ObjectProperty [bound, value: null] is
> null
> java.lang.NullPointerException
> at
> com.sun.javafx.binding.SelectBinding$SelectBindingHelper.getObservableValue(SelectBinding.java:481)
> at
> com.sun.javafx.binding.SelectBinding$AsObject.computeValue(SelectBinding.java:92)
> at javafx.beans.binding.ObjectBinding.get(ObjectBinding.java:152)
> at
> javafx.beans.binding.ObjectExpression.getValue(ObjectExpression.java:49)
> at
> com.sun.javafx.binding.ExpressionHelper.addListener(ExpressionHelper.java:53)
> at
> javafx.beans.binding.ObjectBinding.addListener(ObjectBinding.java:71)
> at
> javafx.beans.property.ObjectPropertyBase.bind(ObjectPropertyBase.java:170)
> at
> hs.mediasystem.TitledBlockSample.createCastingsRow(TitledBlockSample.java:114)
> at hs.mediasystem.TitledBlockSample.start(TitledBlockSample.java:78)
> at
> com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:810)
> at
> com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:260)
> at
> com.sun.javafx.application.PlatformImpl$5$1.run(PlatformImpl.java:226)
> at
> com.sun.javafx.application.PlatformImpl$5$1.run(PlatformImpl.java:223)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:223)
> at
> com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
> at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
> at
> com.sun.glass.ui.win.WinApplication.access$300(WinApplication.java:39)
> at
> com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:101)
> at java.lang.Thread.run(Thread.java:724)
>
> Regards,
> --John
>
More information about the openjfx-dev
mailing list