in library/src/main/java/com/alibaba/dcm/internal/InetAddressCacheUtilForNew.java [215:233]
public static DnsCache listInetAddressCache()
throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {
final List<DnsCacheEntry> retCache = new ArrayList<>();
final List<DnsCacheEntry> retNegativeCache = new ArrayList<>();
final ConcurrentMap<String, Object> cache = getCacheOfInetAddress();
for (Map.Entry<String, Object> entry : cache.entrySet()) {
final String host = entry.getKey();
DnsCacheEntry dnsCacheEntry = inetAddress$Addresses2DnsCacheEntry(host, entry.getValue());
if (dnsCacheEntry.getIps().length == 0) {
retNegativeCache.add(dnsCacheEntry);
} else {
retCache.add(dnsCacheEntry);
}
}
return new DnsCache(retCache, retNegativeCache);
}