Skip to content

Commit 7890700

Browse files
committed
refactor: remove ExpirySetOfInetAddress before CacheOfInetAddress, improve stability
1 parent fe31d2f commit 7890700

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/src/main/java/com/alibaba/dcm/internal/InetAddressCacheUtilForJava9Plus.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ private static Object newCachedAddresses(String host, String[] ips, long expirat
9595
}
9696

9797
public static void removeInetAddressCache(String host) throws NoSuchFieldException, IllegalAccessException {
98-
getCacheOfInetAddress().remove(host);
9998
removeHostFromExpirySetOfInetAddress(host);
99+
getCacheOfInetAddress().remove(host);
100100
}
101101

102102
/**
@@ -311,8 +311,8 @@ private static void initFieldsOfAddresses() throws ClassNotFoundException, NoSuc
311311
}
312312

313313
public static void clearInetAddressCache() throws NoSuchFieldException, IllegalAccessException {
314-
getCacheOfInetAddress().clear();
315314
getExpirySetOfInetAddress().clear();
315+
getCacheOfInetAddress().clear();
316316
}
317317

318318
private InetAddressCacheUtilForJava9Plus() {

0 commit comments

Comments
 (0)