Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions java/net/ResolverCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@
*/
class ResolverCache
{
/**
* The cache itself. It is declared before the TTLs: computing them can
* load classes that resolve names, and the cache must exist by then.
Comment thread
guillerodriguez marked this conversation as resolved.
* Lookups made during that time see both TTLs as 0, so their results
* are not cached.
*/
private static HashMap<Object, Entry> cache = new HashMap<Object, Entry>();

/**
* List of entries which may expire.
*/
private static LinkedList<Entry> killqueue = new LinkedList<Entry>();

/**
* The time in seconds for which successful lookups are cached.
*/
Expand All @@ -94,16 +107,6 @@ private static int getTTL(String propName, int defaultValue)
return Integer.parseInt(propValue);
}

/**
* The cache itself.
*/
private static HashMap<Object, Entry> cache = new HashMap<Object, Entry>();

/**
* List of entries which may expire.
*/
private static LinkedList<Entry> killqueue = new LinkedList<Entry>();

/**
* Return the hostname for the specified IP address.
*
Expand Down
Loading