dooApp/FXForm2

java.lang.NullPointerException Integer/Boolean

Closed this issue · 7 comments

Dear FXForm2 Team,

I generated a Bean Model with a custom JOOQ Generator.
Cause there're "null" Values in some Rows for Boolean- and Integer-Types needed it's not possible
to initialize these variables in the Bean Model with (true/false) (0)

Is there a solution for this how to handle this Null Pointer expection without setting Values?

Thank you very much.

E.x.
private SimpleIntegerProperty idMeasurements;

Throwing Excpetion:

Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
	at javafx.beans.property.adapter.JavaBeanIntegerProperty.lambda$get$38(JavaBeanIntegerProperty.java:95)
	at java.security.AccessController.doPrivileged(Native Method)

Could you provide a simple unit test reproducing the issue ?

xylo commented

The given unit test reproduces it with plain old Integer property. It throws exactly the mentioned JavaBeanIntegerProperty. When I use a SimpleIntegerProperty I actually get another exception which should be maybe handled in another bug report.

Thanks for the unit test. It looks like the JavaBeanIntegerProperty does not support nullable values, see http://mail.openjdk.java.net/pipermail/openjfx-dev/2015-June/017386.html

One solution might be to wrap the JavaBeanXXXPropertyElement into JavaBeanObjectProperty, I will try to submit a fix for this.

xylo commented

Great! Thanks!

I submitted a fix. Could you try with the latest 8.2.0-SNAPSHOT ?

xylo commented

Works like a charm!

Fixed in 8.1.2