You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "gilPts (via GitHub)" <gi...@apache.org> on 2023/05/05 15:18:56 UTC
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #634: Improved: getConfigParam can't be configured at runtime (OFBIZ-12815)
gilPts commented on code in PR #634:
URL: https://github.com/apache/ofbiz-framework/pull/634#discussion_r1186220896
##########
framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtilProperties.java:
##########
@@ -123,6 +123,117 @@ public static String getPropertyValueFromDelegatorName(String resource, String n
}
}
+ public static <T> Object getPropertyValue(String resource, String name, Object defaultValue, Delegator delegator, Class<T> clazz) {
+ Map<String, String> propMap = getSystemPropertyValue(resource, name, delegator);
+ if ("Y".equals(propMap.get("isExistInDb"))) {
+ String s = propMap.get("value");
+ if (UtilValidate.isEmpty(s)) {
+ return defaultValue;
+ }
+ try {
+ if (clazz.componentType() == Integer.class) {
Review Comment:
Hello, since it is for trunk and java 17 is available, what do you think about using switch pattern matching (and Guarded Pattern)
ref : https://openjdk.org/jeps/406
Thanks and regards,
Gil
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org