Copilot commented on code in PR #5625:
URL: https://github.com/apache/ignite-3/pull/5625#discussion_r2041999362


##########
modules/configuration/src/main/java/org/apache/ignite/internal/configuration/hocon/HoconPrimitiveConfigurationSource.java:
##########
@@ -125,23 +125,23 @@ public static <T> T unwrapPrimitive(ConfigValue 
hoconCfgValue, Class<T> clazz, L
         assert !clazz.isPrimitive();
 
         if (clazz == String.class) {
-            if (hoconCfgValue.valueType() != STRING) {
-                throw wrongTypeException(clazz, path, idx);
-            }
+            String stringValue = unwrapStringValue(hoconCfgValue);
 
-            return clazz.cast(hoconCfgValue.unwrapped());
+            return clazz.cast(stringValue);
         } else if (clazz == Boolean.class) {
             if (hoconCfgValue.valueType() != BOOLEAN) {
                 throw wrongTypeException(clazz, path, idx);
             }
 
             return clazz.cast(hoconCfgValue.unwrapped());
         } else if (clazz == Character.class) {
-            if (hoconCfgValue.valueType() != STRING || 
hoconCfgValue.unwrapped().toString().length() != 1) {
+            String stringValue = unwrapStringValue(hoconCfgValue);

Review Comment:
   [nitpick] Consider trimming stringValue for character conversion to avoid 
rejecting valid inputs that may contain unwanted leading or trailing whitespace.
   ```suggestion
               String stringValue = unwrapStringValue(hoconCfgValue).trim();
   ```



-- 
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-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to