life- commented on code in PR #609:
URL: https://github.com/apache/skywalking-java/pull/609#discussion_r1325696098
##########
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:
@wu-sheng done
--
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]