From f7566331c836d9c1ecac9e00fb044c1e83058ef3 Mon Sep 17 00:00:00 2001 From: caoyixiong Date: Fri, 28 Jun 2019 11:55:28 +0800 Subject: [PATCH] format --- .../com/alibaba/nacos/client/naming/utils/CollectionUtils.java | 2 +- .../java/com/alibaba/nacos/client/naming/utils/IoUtils.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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);