diff --git a/java/net/ResolverCache.java b/java/net/ResolverCache.java index d7e5ed407b..75e3ccd9eb 100644 --- a/java/net/ResolverCache.java +++ b/java/net/ResolverCache.java @@ -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. + * Lookups made during that time see both TTLs as 0, so their results + * are not cached. + */ + private static HashMap cache = new HashMap(); + + /** + * List of entries which may expire. + */ + private static LinkedList killqueue = new LinkedList(); + /** * The time in seconds for which successful lookups are cached. */ @@ -94,16 +107,6 @@ private static int getTTL(String propName, int defaultValue) return Integer.parseInt(propValue); } - /** - * The cache itself. - */ - private static HashMap cache = new HashMap(); - - /** - * List of entries which may expire. - */ - private static LinkedList killqueue = new LinkedList(); - /** * Return the hostname for the specified IP address. *