From 104f398b5b8a9d63f755e5156aafa4a6584e0104 Mon Sep 17 00:00:00 2001 From: zifeihan Date: Thu, 20 May 2021 05:50:16 +0800 Subject: [PATCH] Fix the conversion problem of float type in ConfigInitializer. (#6974) --- CHANGES.md | 1 + .../java/org/apache/skywalking/apm/util/ConfigInitializer.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 848fb49cb..4e3c6c65d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -27,6 +27,7 @@ Release Notes. * Add `okhttp-4.x` plugin. * Fix NPE when thrift field is nested in plugin `thrift` * Fix possible NullPointerException in agent's ES plugin. +* Fix the conversion problem of float type in ConfigInitializer. #### OAP-Backend * BugFix: filter invalid Envoy access logs whose socket address is empty. diff --git a/apm-commons/apm-util/src/main/java/org/apache/skywalking/apm/util/ConfigInitializer.java b/apm-commons/apm-util/src/main/java/org/apache/skywalking/apm/util/ConfigInitializer.java index d313ba8c8..4e400a0e1 100644 --- a/apm-commons/apm-util/src/main/java/org/apache/skywalking/apm/util/ConfigInitializer.java +++ b/apm-commons/apm-util/src/main/java/org/apache/skywalking/apm/util/ConfigInitializer.java @@ -112,7 +112,7 @@ public class ConfigInitializer { } else if (boolean.class.equals(type) || Boolean.class.equals(type)) { result = Boolean.valueOf(value); } else if (float.class.equals(type) || Float.class.equals(type)) { - result = Boolean.valueOf(value); + result = Float.valueOf(value); } else if (double.class.equals(type) || Double.class.equals(type)) { result = Double.valueOf(value); } else if (List.class.equals(type)) {