The EL DocumentModelResolver performs conversions on types before calling the document model setPropertyValue and getPropertyValue API.
At least on set, more property types should be handled, see conversion use cases only handled by the DocumentModelResolver:
- Date/Calendar conversions seem to be already handled by core, but conversion on get might still be useful for JSF components handling dates (they might not handle Calendar instances properly)
- Long properties conversion could be made safer by handling BigDecimal properties (or at least BigInteger), same for Double (floating point) properties
LongProperty#normalize method should also be reviewed, using BigDecimal#longValueExact is better than BigDecimal#longValue.
In the case of
NXP-16225, the DocumentModelResolver#getType method might need a check too (there might be a missing use case in there, explaining why a BigDecimal is generated instead of a BigInteger)