fjtirado commented on code in PR #3278:
URL: 
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3278#discussion_r1384742110


##########
api/kogito-api/src/main/java/org/kie/kogito/internal/utils/ConversionUtils.java:
##########
@@ -81,6 +81,8 @@ public static <T> Collection<T> convertToCollection(Object 
value, Class<T> clazz
     public static <T> T convert(Object value, Class<T> clazz, Function<Object, 
String> stringConverter) {
         if (value == null || clazz.isAssignableFrom(value.getClass())) {
             return clazz.cast(value);
+        } else if (isConvertibleFromStringJavaBaseType(clazz)) {

Review Comment:
   I would have preferred to include a long if else here to avoid a double 
check (for example, if class is double you are checking it twice,once in 
isConvertible and another in convert, so adding a new check (like Byte, as I 
suggested) implies changes in two places. 
   The drawback is that the method would be longer, but I think is a good 
compromise. Anyway, you are the writer, you chose ;)



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to