ofbiz-framework
ofbiz-framework copied to clipboard
Improved: EntityUtil getProperty Methods dont use entity (OFBIZ-12815)
The getProperty methods in EntityUtilProperties don't use entity at all. All of the getProperty methods simply lead to UtilProperties and therefore no configure during runtime is possible.
Improved: New methods have been written so the entity usage is now functional.
This sounds good to me.
Should we not deprecate the previous getPropertyNumber(String resource, String name, double defaultValue)
until getPropertyAsBigDecimal(String resource, String name, BigDecimal defaultNumber)
?
Hey Jacques,
I will provide another commit in which i adjust the switch statement mentioned by Gil and also deprecate the previous ones.
Hi @thahn27,
I checked the usage in Java and Groovy code of the previous methods I talked about above. Most of them are not used at all OOTB. getPropertyAsBoolean and getPropertyAsBigDecimal are both used twice in Java, getPropertyAsInteger is used 21 times in Java and 6 in Groovy.
It could be that OFBiz users are using them more. But it's really easy to replace them by UtilProperties ones or the new EntityUtilProperties ones. So maybe we could remove them all together OOTB. And replace those used by calls to the new ones you introduce. I'll start a discussion on dev ML about that.
I send an email to dev ML 1 hour ago but it does not appear yet. I wonder why, but let's wait