Potential NPE in generated Category Beans
As it becomes visible in https://github.com/virtualsatellite/VirtualSatellite4-CEF/issues/99 there is a case where IntPropertiesBeans in CatgeoryBeans may hand back a null as value. Since the Properties hand back the AutoBoxingType which can be null, the Category hands back the primitive type. The cast results in a NullPointerException.
The CodeGenerator for the CatgeoryBean should be adjusted to hand back the AutoBoxingTypes rather than the primitives, e.g.:
public Long «propertyMethodGet(property)»() {
«propertyMethodSafeAccess(property)»;
return «property.name».getValue();
}
public boolean «propertyMethodIsSet(property)»() {
«propertyMethodSafeAccess(property)»;
return «property.name».isSet();
}
instead of:
public long «propertyMethodGet(property)»() {
«propertyMethodSafeAccess(property)»;
return «property.name».getValue();
}
public boolean «propertyMethodIsSet(property)»() {
«propertyMethodSafeAccess(property)»;
return «property.name».isSet();
}
But don't change the boolean from the isSet to an AutoBoxingType.
Shall we also change float properties to return Double null if it's not set insteat of NaN?
@PhilMFischer Please check ticket.