diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/utils/CollectionUtils.java b/client/src/main/java/com/alibaba/nacos/client/naming/utils/CollectionUtils.java index a115505dc..65f9e3227 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/utils/CollectionUtils.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/utils/CollectionUtils.java @@ -46,7 +46,7 @@ public class CollectionUtils { /** * Constant to avoid repeated object creation */ - private static Integer INTEGER_ONE = 1; + private static final Integer INTEGER_ONE = 1; /** * CollectionUtils should not normally be instantiated. diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/utils/IoUtils.java b/client/src/main/java/com/alibaba/nacos/client/naming/utils/IoUtils.java index e6795a6fa..b4a5afdde 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/utils/IoUtils.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/utils/IoUtils.java @@ -25,6 +25,7 @@ import java.util.List; import java.util.zip.GZIPInputStream; import static com.alibaba.nacos.client.utils.LogUtils.NAMING_LOGGER; +import static org.apache.commons.lang3.CharEncoding.UTF_8; /** * @author nkorange @@ -34,7 +35,7 @@ public class IoUtils { static public String toString(InputStream input, String encoding) { try { - return (null == encoding) ? toString(new InputStreamReader(input, "UTF-8")) + return (null == encoding) ? toString(new InputStreamReader(input, UTF_8)) : toString(new InputStreamReader(input, encoding)); } catch (Exception e) { NAMING_LOGGER.error("NA", "read input failed.", e);