Dynamic proxies should return default values for primitive type properties
Closed this issue · 0 comments
cyberborean commented
In the current implementation, reading a primitive type property of a dynamic proxy instantiated from a RDFBean interface causes NullPointerException
if the property has not been initialized. This is due to the InvocationHandler.invoke()
contract:
If the value returned by this method is
null
and the interface method's return type is primitive, then aNullPointerException
will be thrown by the method invocation on the proxy instance.
We may want to return the default values for primitive type properties instead of throwing a NPE (see https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html).