wu-sheng commented on code in PR #609:
URL: https://github.com/apache/skywalking-java/pull/609#discussion_r1325415499


##########
apm-commons/apm-util/src/main/java/org/apache/skywalking/apm/util/ConfigInitializer.java:
##########
@@ -85,9 +85,16 @@ private static void initNextLevel(Properties properties, 
Class<?> recentConfigTy
                     } else {
                         // Convert the value into real type
                         final Length lengthDefine = 
field.getAnnotation(Length.class);
-                        if (lengthDefine != null && propertyValue.length() > 
lengthDefine.value()) {
-                            StringUtil.cut(propertyValue, 
lengthDefine.value());
-                            System.err.printf("The config value will be 
truncated , because the length max than %d : %s -> %s%n", lengthDefine.value(), 
configKey, propertyValue);
+                        if (lengthDefine != null) {
+                            int lengthLimited = lengthDefine.value();
+                            String lengthKey = String.format("%s#length", 
configKey);
+                            if (properties.containsKey(lengthKey)) {
+                                lengthLimited = Math.max(lengthLimited, 
Integer.valueOf(properties.getProperty(lengthKey, "0")));
+                            }

Review Comment:
   You are adding a feature to provide customization, I can't see why bigger is 
acceptable, but smaller isn't.
   Your explanation seems doesn't make sense.
   
   All length relative configurations are accepting value length in both ways. 
   
   Please update the codes to provide an override capability, rather than 
within this condition.



-- 
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]

Reply via email to