diff --git a/common/src/main/java/com/alibaba/nacos/common/utils/ClassUtils.java b/common/src/main/java/com/alibaba/nacos/common/utils/ClassUtils.java index 5f4250971..565f5ac43 100644 --- a/common/src/main/java/com/alibaba/nacos/common/utils/ClassUtils.java +++ b/common/src/main/java/com/alibaba/nacos/common/utils/ClassUtils.java @@ -18,6 +18,8 @@ package com.alibaba.nacos.common.utils; import com.alibaba.nacos.api.exception.runtime.NacosRuntimeException; +import java.util.Objects; + import static com.alibaba.nacos.api.exception.NacosException.SERVER_ERROR; /** diff --git a/common/src/main/java/com/alibaba/nacos/common/utils/ExceptionUtil.java b/common/src/main/java/com/alibaba/nacos/common/utils/ExceptionUtil.java index 575cfc63c..12b768a1c 100644 --- a/common/src/main/java/com/alibaba/nacos/common/utils/ExceptionUtil.java +++ b/common/src/main/java/com/alibaba/nacos/common/utils/ExceptionUtil.java @@ -18,6 +18,7 @@ package com.alibaba.nacos.common.utils; import java.io.ByteArrayOutputStream; import java.io.PrintStream; +import java.util.Objects; /** * Common methods for exception. diff --git a/common/src/main/java/com/alibaba/nacos/common/utils/MapUtil.java b/common/src/main/java/com/alibaba/nacos/common/utils/MapUtil.java index 3e1305810..f466b35fb 100644 --- a/common/src/main/java/com/alibaba/nacos/common/utils/MapUtil.java +++ b/common/src/main/java/com/alibaba/nacos/common/utils/MapUtil.java @@ -21,6 +21,7 @@ import com.alibaba.nacos.common.NotThreadSafe; import java.util.Collection; import java.util.Dictionary; import java.util.Map; +import java.util.Objects; import java.util.function.Predicate; /** diff --git a/common/src/main/java/com/alibaba/nacos/common/utils/Objects.java b/common/src/main/java/com/alibaba/nacos/common/utils/Objects.java deleted file mode 100644 index 79e69546c..000000000 --- a/common/src/main/java/com/alibaba/nacos/common/utils/Objects.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.alibaba.nacos.common.utils; - -import java.util.Arrays; -import java.util.Comparator; -import java.util.List; - -/** - * Objects utils. - * - * @author liaochuntao - */ -@SuppressWarnings("PMD.RemoveCommentedCodeRule") -public class Objects { - - /** - * Returns {@code true} if the arguments are equal to each other and {@code false} otherwise. Consequently, if both - * arguments are {@code null}, {@code true} is returned and if exactly one argument is {@code null}, {@code false} - * is returned. Otherwise, equality is determined by using the {@link Object#equals equals} method of the first - * argument. - * - * @param a an object - * @param b an object to be compared with {@code a} for equality - * @return {@code true} if the arguments are equal to each other and {@code false} otherwise - * @see Object#equals(Object) - */ - public static boolean equals(Object a, Object b) { - return (a == b) || (a != null && a.equals(b)); - } - - /** - * Returns the hash code of a non-{@code null} argument and 0 for a {@code null} argument. - * - * @param o an object - * @return the hash code of a non-{@code null} argument and 0 for a {@code null} argument - * @see Object#hashCode - */ - public static int hashCode(Object o) { - return o != null ? o.hashCode() : 0; - } - - /** - * Generates a hash code for a sequence of input values. The hash code is generated as if all the input values were - * placed into an array, and that array were hashed by calling {@link Arrays#hashCode(Object[])}. - * - *

This method is useful for implementing {@link - * Object#hashCode()} on objects containing multiple fields. For example, if an object that has three fields, {@code - * x}, {@code y}, and {@code z}, one could write: - * - *

-     * @Override
-     * public int hashCode() {
-     *     return Objects.hash(x, y, z);
-     * }
-     * 
- * - * Warning: When a single object reference is supplied, the returned - * value does not equal the hash code of that object reference. This value can be computed by calling {@link - * #hashCode(Object)}. - * - * @param values the values to be hashed - * @return a hash value of the sequence of input values - * @see Arrays#hashCode(Object[]) - * @see List#hashCode - */ - public static int hash(Object... values) { - return Arrays.hashCode(values); - } - - /** - * Returns the result of calling {@code toString} for a non-{@code null} argument and {@code "null"} for a {@code - * null} argument. - * - * @param o an object - * @return the result of calling {@code toString} for a non-{@code null} argument and {@code "null"} for a {@code - * null} argument - * @see Object#toString - * @see String#valueOf(Object) - */ - public static String toString(Object o) { - return String.valueOf(o); - } - - /** - * Returns the result of calling {@code toString} on the first argument if the first argument is not {@code null} - * and returns the second argument otherwise. - * - * @param o an object - * @param nullDefault string to return if the first argument is {@code null} - * @return the result of calling {@code toString} on the first argument if it is not {@code null} and the second - * argument otherwise. - */ - public static String toString(Object o, String nullDefault) { - return (o != null) ? o.toString() : nullDefault; - } - - /** - * Returns 0 if the arguments are identical and {@code c.compare(a, b)} otherwise. Consequently, if both arguments - * are {@code null} 0 is returned. - * - *

Note that if one of the arguments is {@code null}, a {@code - * NullPointerException} may or may not be thrown depending on what ordering policy, if any, the {@link Comparator - * Comparator} chooses to have for {@code null} values. - * - * @param the type of the objects being compared - * @param a an object - * @param b an object to be compared with {@code a} - * @param c the {@code Comparator} to compare the first two arguments - * @return 0 if the arguments are identical and {@code c.compare(a, b)} otherwise. - * @see Comparable - * @see Comparator - */ - public static int compare(T a, T b, Comparator c) { - return (a == b) ? 0 : c.compare(a, b); - } - - /** - * Checks that the specified object reference is not {@code null}. This method is designed primarily for doing - * parameter validation in methods and constructors, as demonstrated below: - *

-     * public Foo(Bar bar) {
-     *     this.bar = Objects.requireNonNull(bar);
-     * }
-     * 
- * - * @param obj the object reference to check for nullity - * @param the type of the reference - * @return {@code obj} if not {@code null} - * @throws NullPointerException if {@code obj} is {@code null} - */ - public static T requireNonNull(T obj) { - if (obj == null) { - throw new NullPointerException(); - } - return obj; - } - - /** - * Checks that the specified object reference is not {@code null} and throws a customized {@link - * NullPointerException} if it is. This method is designed primarily for doing parameter validation in methods and - * constructors with multiple parameters, as demonstrated below: - *
-     * public Foo(Bar bar, Baz baz) {
-     *     this.bar = Objects.requireNonNull(bar, "bar must not be null");
-     *     this.baz = Objects.requireNonNull(baz, "baz must not be null");
-     * }
-     * 
- * - * @param obj the object reference to check for nullity - * @param message detail message to be used in the event that a {@code NullPointerException} is thrown - * @param the type of the reference - * @return {@code obj} if not {@code null} - * @throws NullPointerException if {@code obj} is {@code null} - */ - public static T requireNonNull(T obj, String message) { - if (obj == null) { - throw new NullPointerException(message); - } - return obj; - } - - /** - * Returns {@code true} if the provided reference is {@code null} otherwise returns {@code false}. - * - * @param obj a reference to be checked against {@code null} - * @return {@code true} if the provided reference is {@code null} otherwise {@code false} - * @apiNote This method exists to be used as a - * @since 1.8 - */ - public static boolean isNull(Object obj) { - return obj == null; - } - - /** - * Returns {@code true} if the provided reference is non-{@code null} otherwise returns {@code false}. - * - * @param obj a reference to be checked against {@code null} - * @return {@code true} if the provided reference is non-{@code null} otherwise {@code false} - * @apiNote This method exists to be used as a - * @since 1.8 - */ - public static boolean nonNull(Object obj) { - return obj != null; - } - - /** - * Returns the first argument if it is non-{@code null} and otherwise returns the non-{@code null} second argument. - * - * @param obj an object - * @param defaultObj a non-{@code null} object to return if the first argument is {@code null} - * @param the type of the reference - * @return the first argument if it is non-{@code null} and otherwise the second argument if it is non-{@code null} - * @throws NullPointerException if both {@code obj} is null and {@code defaultObj} is {@code null} - * @since 9 - */ - public static T requireNonNullElse(T obj, T defaultObj) { - return (obj != null) ? obj : requireNonNull(defaultObj, "defaultObj"); - } -} diff --git a/common/src/main/java/com/alibaba/nacos/common/utils/Observable.java b/common/src/main/java/com/alibaba/nacos/common/utils/Observable.java index 35792aeb2..341dbf642 100644 --- a/common/src/main/java/com/alibaba/nacos/common/utils/Observable.java +++ b/common/src/main/java/com/alibaba/nacos/common/utils/Observable.java @@ -16,6 +16,7 @@ package com.alibaba.nacos.common.utils; +import java.util.Objects; import java.util.Set; /** diff --git a/common/src/main/java/com/alibaba/nacos/common/utils/ThreadUtils.java b/common/src/main/java/com/alibaba/nacos/common/utils/ThreadUtils.java index 987cac77b..db1767aa3 100644 --- a/common/src/main/java/com/alibaba/nacos/common/utils/ThreadUtils.java +++ b/common/src/main/java/com/alibaba/nacos/common/utils/ThreadUtils.java @@ -18,6 +18,7 @@ package com.alibaba.nacos.common.utils; import org.slf4j.Logger; +import java.util.Objects; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; diff --git a/common/src/main/java/com/alibaba/nacos/common/utils/VersionUtils.java b/common/src/main/java/com/alibaba/nacos/common/utils/VersionUtils.java index d22fd2bac..375590583 100644 --- a/common/src/main/java/com/alibaba/nacos/common/utils/VersionUtils.java +++ b/common/src/main/java/com/alibaba/nacos/common/utils/VersionUtils.java @@ -18,6 +18,7 @@ package com.alibaba.nacos.common.utils; import java.io.InputStream; import java.util.Comparator; +import java.util.Objects; import java.util.Properties; /** diff --git a/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java b/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java index df4301feb..5ef91c769 100755 --- a/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java @@ -20,7 +20,6 @@ import com.alibaba.nacos.auth.annotation.Secured; import com.alibaba.nacos.auth.common.ActionTypes; import com.alibaba.nacos.common.model.RestResult; import com.alibaba.nacos.common.model.RestResultUtils; -import com.alibaba.nacos.common.utils.Objects; import com.alibaba.nacos.common.notify.NotifyCenter; import com.alibaba.nacos.config.server.constant.Constants; import com.alibaba.nacos.config.server.model.event.DerbyImportEvent; @@ -31,8 +30,8 @@ import com.alibaba.nacos.config.server.service.repository.PersistService; import com.alibaba.nacos.config.server.service.repository.embedded.DatabaseOperate; import com.alibaba.nacos.config.server.utils.LogUtil; import com.alibaba.nacos.config.server.utils.PropertyUtil; -import com.alibaba.nacos.sys.utils.ApplicationUtils; import com.alibaba.nacos.core.utils.WebUtils; +import com.alibaba.nacos.sys.utils.ApplicationUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -50,6 +49,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.util.List; import java.util.Map; +import java.util.Objects; /** * Manage controllers. diff --git a/config/src/main/java/com/alibaba/nacos/config/server/controller/HistoryController.java b/config/src/main/java/com/alibaba/nacos/config/server/controller/HistoryController.java index 59e07f722..b08220edc 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/controller/HistoryController.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/controller/HistoryController.java @@ -19,7 +19,6 @@ package com.alibaba.nacos.config.server.controller; import com.alibaba.nacos.auth.annotation.Secured; import com.alibaba.nacos.auth.common.ActionTypes; import com.alibaba.nacos.auth.exception.AccessException; -import com.alibaba.nacos.common.utils.Objects; import com.alibaba.nacos.config.server.auth.ConfigResourceParser; import com.alibaba.nacos.config.server.constant.Constants; import com.alibaba.nacos.config.server.model.ConfigHistoryInfo; @@ -33,6 +32,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.util.Objects; + /** * History management controller. * diff --git a/console/src/main/java/com/alibaba/nacos/console/controller/UserController.java b/console/src/main/java/com/alibaba/nacos/console/controller/UserController.java index 2101603c5..2ce64be9d 100644 --- a/console/src/main/java/com/alibaba/nacos/console/controller/UserController.java +++ b/console/src/main/java/com/alibaba/nacos/console/controller/UserController.java @@ -25,7 +25,6 @@ import com.alibaba.nacos.auth.exception.AccessException; import com.alibaba.nacos.common.model.RestResult; import com.alibaba.nacos.common.model.RestResultUtils; import com.alibaba.nacos.common.utils.JacksonUtils; -import com.alibaba.nacos.common.utils.Objects; import com.alibaba.nacos.config.server.auth.RoleInfo; import com.alibaba.nacos.config.server.model.User; import com.alibaba.nacos.config.server.utils.RequestUtil; @@ -57,6 +56,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; +import java.util.Objects; /** * User related methods entry. diff --git a/core/src/main/java/com/alibaba/nacos/core/cluster/MemberUtil.java b/core/src/main/java/com/alibaba/nacos/core/cluster/MemberUtil.java index b9465b4ec..2f7280e1f 100644 --- a/core/src/main/java/com/alibaba/nacos/core/cluster/MemberUtil.java +++ b/core/src/main/java/com/alibaba/nacos/core/cluster/MemberUtil.java @@ -18,7 +18,6 @@ package com.alibaba.nacos.core.cluster; import com.alibaba.nacos.common.utils.ExceptionUtil; import com.alibaba.nacos.common.utils.InternetAddressUtil; -import com.alibaba.nacos.common.utils.Objects; import com.alibaba.nacos.core.utils.Loggers; import com.alibaba.nacos.sys.env.EnvUtil; import org.apache.commons.lang3.StringUtils; @@ -30,6 +29,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.concurrent.ThreadLocalRandom; import java.util.function.Predicate; diff --git a/core/src/main/java/com/alibaba/nacos/core/distributed/raft/utils/FailoverClosureImpl.java b/core/src/main/java/com/alibaba/nacos/core/distributed/raft/utils/FailoverClosureImpl.java index ade075100..6ec8a5167 100644 --- a/core/src/main/java/com/alibaba/nacos/core/distributed/raft/utils/FailoverClosureImpl.java +++ b/core/src/main/java/com/alibaba/nacos/core/distributed/raft/utils/FailoverClosureImpl.java @@ -16,11 +16,11 @@ package com.alibaba.nacos.core.distributed.raft.utils; -import com.alibaba.nacos.common.utils.Objects; import com.alibaba.nacos.consistency.entity.Response; import com.alibaba.nacos.consistency.exception.ConsistencyException; import com.alipay.sofa.jraft.Status; +import java.util.Objects; import java.util.concurrent.CompletableFuture; /** diff --git a/core/src/main/java/com/alibaba/nacos/core/remote/control/TpsMonitorPoint.java b/core/src/main/java/com/alibaba/nacos/core/remote/control/TpsMonitorPoint.java index 81e42d92e..ad14d2085 100644 --- a/core/src/main/java/com/alibaba/nacos/core/remote/control/TpsMonitorPoint.java +++ b/core/src/main/java/com/alibaba/nacos/core/remote/control/TpsMonitorPoint.java @@ -16,7 +16,6 @@ package com.alibaba.nacos.core.remote.control; -import com.alibaba.nacos.common.utils.Objects; import com.alibaba.nacos.core.utils.Loggers; import java.text.SimpleDateFormat; @@ -26,6 +25,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.concurrent.TimeUnit; /** diff --git a/naming/src/main/java/com/alibaba/nacos/naming/consistency/ephemeral/distro/DistroConsistencyServiceImpl.java b/naming/src/main/java/com/alibaba/nacos/naming/consistency/ephemeral/distro/DistroConsistencyServiceImpl.java index 38599ff35..535e46e74 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/consistency/ephemeral/distro/DistroConsistencyServiceImpl.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/consistency/ephemeral/distro/DistroConsistencyServiceImpl.java @@ -18,7 +18,6 @@ package com.alibaba.nacos.naming.consistency.ephemeral.distro; import com.alibaba.nacos.api.common.Constants; import com.alibaba.nacos.api.exception.NacosException; -import com.alibaba.nacos.common.utils.Objects; import com.alibaba.nacos.consistency.DataOperation; import com.alibaba.nacos.core.distributed.distro.DistroConfig; import com.alibaba.nacos.core.distributed.distro.DistroProtocol; @@ -50,6 +49,7 @@ import javax.annotation.PostConstruct; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Optional; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/impl/NamingSnapshotOperation.java b/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/impl/NamingSnapshotOperation.java index a5a04cb1c..7021286f2 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/impl/NamingSnapshotOperation.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/impl/NamingSnapshotOperation.java @@ -16,7 +16,6 @@ package com.alibaba.nacos.naming.consistency.persistent.impl; -import com.alibaba.nacos.common.utils.Objects; import com.alibaba.nacos.consistency.snapshot.LocalFileMeta; import com.alibaba.nacos.consistency.snapshot.Reader; import com.alibaba.nacos.consistency.snapshot.Writer; @@ -26,6 +25,7 @@ import com.alibaba.nacos.sys.utils.DiskUtils; import com.alipay.sofa.jraft.util.CRC64; import java.nio.file.Paths; +import java.util.Objects; import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.zip.Checksum; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java b/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java index e4d1605c6..e8df18ef4 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java @@ -21,7 +21,6 @@ import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.api.naming.utils.NamingUtils; import com.alibaba.nacos.common.utils.InternetAddressUtil; import com.alibaba.nacos.common.utils.JacksonUtils; -import com.alibaba.nacos.common.utils.Objects; import com.alibaba.nacos.core.cluster.Member; import com.alibaba.nacos.core.cluster.ServerMemberManager; import com.alibaba.nacos.naming.consistency.ConsistencyService; @@ -60,6 +59,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.StringJoiner; import java.util.concurrent.ConcurrentHashMap; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/v2/metadata/AbstractMetadataSnapshotOperation.java b/naming/src/main/java/com/alibaba/nacos/naming/core/v2/metadata/AbstractMetadataSnapshotOperation.java index 0046d9e17..d7475b04d 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/v2/metadata/AbstractMetadataSnapshotOperation.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/v2/metadata/AbstractMetadataSnapshotOperation.java @@ -16,7 +16,6 @@ package com.alibaba.nacos.naming.core.v2.metadata; -import com.alibaba.nacos.common.utils.Objects; import com.alibaba.nacos.consistency.snapshot.LocalFileMeta; import com.alibaba.nacos.consistency.snapshot.Reader; import com.alibaba.nacos.consistency.snapshot.Writer; @@ -27,6 +26,7 @@ import com.alipay.sofa.jraft.util.CRC64; import java.io.IOException; import java.io.InputStream; import java.nio.file.Paths; +import java.util.Objects; import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.zip.Checksum; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/v2/service/impl/PersistentClientOperationServiceImpl.java b/naming/src/main/java/com/alibaba/nacos/naming/core/v2/service/impl/PersistentClientOperationServiceImpl.java index 5de729a17..7c0a16671 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/v2/service/impl/PersistentClientOperationServiceImpl.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/v2/service/impl/PersistentClientOperationServiceImpl.java @@ -21,7 +21,6 @@ import com.alibaba.nacos.api.exception.runtime.NacosRuntimeException; import com.alibaba.nacos.api.naming.pojo.Instance; import com.alibaba.nacos.common.notify.NotifyCenter; import com.alibaba.nacos.common.utils.ClassUtils; -import com.alibaba.nacos.common.utils.Objects; import com.alibaba.nacos.consistency.DataOperation; import com.alibaba.nacos.consistency.SerializeFactory; import com.alibaba.nacos.consistency.Serializer; @@ -36,6 +35,7 @@ import com.alibaba.nacos.consistency.snapshot.SnapshotOperation; import com.alibaba.nacos.consistency.snapshot.Writer; import com.alibaba.nacos.core.distributed.ProtocolManager; import com.alibaba.nacos.naming.consistency.persistent.impl.AbstractSnapshotOperation; +import com.alibaba.nacos.naming.constants.Constants; import com.alibaba.nacos.naming.core.v2.ServiceManager; import com.alibaba.nacos.naming.core.v2.client.Client; import com.alibaba.nacos.naming.core.v2.client.ClientAttributes; @@ -47,7 +47,6 @@ import com.alibaba.nacos.naming.core.v2.pojo.InstancePublishInfo; import com.alibaba.nacos.naming.core.v2.pojo.Service; import com.alibaba.nacos.naming.core.v2.service.ClientOperationService; import com.alibaba.nacos.naming.pojo.Subscriber; -import com.alibaba.nacos.naming.constants.Constants; import com.alibaba.nacos.sys.utils.ApplicationUtils; import com.alibaba.nacos.sys.utils.DiskUtils; import com.alipay.sofa.jraft.util.CRC64; @@ -62,6 +61,7 @@ import java.nio.file.Paths; import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantReadWriteLock; diff --git a/sys/src/main/java/com/alibaba/nacos/sys/env/EnvUtil.java b/sys/src/main/java/com/alibaba/nacos/sys/env/EnvUtil.java index 367fcfd21..9b1ea71f6 100644 --- a/sys/src/main/java/com/alibaba/nacos/sys/env/EnvUtil.java +++ b/sys/src/main/java/com/alibaba/nacos/sys/env/EnvUtil.java @@ -18,7 +18,6 @@ package com.alibaba.nacos.sys.env; import com.alibaba.nacos.common.JustForTest; import com.alibaba.nacos.common.utils.IoUtils; -import com.alibaba.nacos.common.utils.Objects; import com.alibaba.nacos.common.utils.StringUtils; import com.alibaba.nacos.common.utils.ThreadUtils; import com.alibaba.nacos.sys.utils.DiskUtils; @@ -42,6 +41,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.Objects; /** * Its own configuration information manipulation tool class. diff --git a/sys/src/main/java/com/alibaba/nacos/sys/utils/DiskUtils.java b/sys/src/main/java/com/alibaba/nacos/sys/utils/DiskUtils.java index 642862849..a7282550e 100644 --- a/sys/src/main/java/com/alibaba/nacos/sys/utils/DiskUtils.java +++ b/sys/src/main/java/com/alibaba/nacos/sys/utils/DiskUtils.java @@ -17,7 +17,6 @@ package com.alibaba.nacos.sys.utils; import com.alibaba.nacos.common.utils.ByteUtils; -import com.alibaba.nacos.common.utils.Objects; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.io.output.NullOutputStream; @@ -43,6 +42,7 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.Objects; import java.util.function.Consumer; import java.util.zip.CheckedInputStream; import java.util.zip.CheckedOutputStream;