Skip to content

Commit 88830e3

Browse files
committed
! fix: unify double check conditions
1 parent 83d28b3 commit 88830e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,11 @@ private static List<DnsCacheEntry> convert(Map<String, Object> cache) throws Ill
242242
private static DnsCacheEntry inetAddress$CacheEntry2DnsCacheEntry(String host, Object entry) throws IllegalAccessException {
243243
if (expirationFieldOfInetAddress$CacheEntry == null || addressesFieldOfInetAddress$CacheEntry == null) {
244244
synchronized (InetAddressCacheUtilForJava8Minus.class) {
245-
if (expirationFieldOfInetAddress$CacheEntry == null) { // double check
245+
if (expirationFieldOfInetAddress$CacheEntry == null || addressesFieldOfInetAddress$CacheEntry == null) { // double check
246246
Class<?> cacheEntryClass = entry.getClass();
247247
// InetAddress.CacheEntry has 2 filed:
248248
// - for jdk 6, address and expiration
249-
// - for jdk 7+, addresses(*renamed* from 6!) and expiration
249+
// - for jdk 7+, addresses(*renamed*!) and expiration
250250
// code in jdk 6:
251251
// https://hg.openjdk.java.net/jdk6/jdk6/jdk/file/8deef18bb749/src/share/classes/java/net/InetAddress.java#l739
252252
// code in jdk 7:

0 commit comments

Comments
 (0)