diff options
Diffstat (limited to 'libjava/classpath/java/net/ResolverCache.java')
-rw-r--r-- | libjava/classpath/java/net/ResolverCache.java | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/libjava/classpath/java/net/ResolverCache.java b/libjava/classpath/java/net/ResolverCache.java index ad329b6075d..d7e5ed407b8 100644 --- a/libjava/classpath/java/net/ResolverCache.java +++ b/libjava/classpath/java/net/ResolverCache.java @@ -119,21 +119,21 @@ class ResolverCache Entry entry = get(key); if (entry != null) { - if (entry.value == null) - throw new UnknownHostException(); - return (String) entry.value; + if (entry.value == null) + throw new UnknownHostException(); + return (String) entry.value; } try { - String hostname = VMInetAddress.getHostByAddr(addr); - put(new Entry(key, hostname)); - return hostname; + String hostname = VMInetAddress.getHostByAddr(addr); + put(new Entry(key, hostname)); + return hostname; } catch (UnknownHostException e) { - put(new Entry(key, null)); - throw e; + put(new Entry(key, null)); + throw e; } } @@ -152,21 +152,21 @@ class ResolverCache Entry entry = get(hostname); if (entry != null) { - if (entry.value == null) - throw new UnknownHostException(); - return (byte[][]) entry.value; + if (entry.value == null) + throw new UnknownHostException(); + return (byte[][]) entry.value; } try { - byte[][] addrs = VMInetAddress.getHostByName(hostname); - put(new Entry(hostname, addrs)); - return addrs; + byte[][] addrs = VMInetAddress.getHostByName(hostname); + put(new Entry(hostname, addrs)); + return addrs; } catch (UnknownHostException e) { - put(new Entry(hostname, null)); - throw e; + put(new Entry(hostname, null)); + throw e; } } @@ -201,9 +201,9 @@ class ResolverCache reap(); if (entry.expires != 0) { - if (entry.expires != -1) - killqueue.add(entry); - cache.put(entry.key, entry); + if (entry.expires != -1) + killqueue.add(entry); + cache.put(entry.key, entry); } } @@ -215,20 +215,20 @@ class ResolverCache { if (!killqueue.isEmpty()) { - long now = System.currentTimeMillis(); + long now = System.currentTimeMillis(); - Iterator iter = killqueue.iterator(); - while (iter.hasNext()) - { - Entry entry = (Entry) iter.next(); - if (entry.expires > now) - break; - cache.remove(entry.key); - iter.remove(); - } + Iterator iter = killqueue.iterator(); + while (iter.hasNext()) + { + Entry entry = (Entry) iter.next(); + if (entry.expires > now) + break; + cache.remove(entry.key); + iter.remove(); + } } } - + /** * An entry in the cache. */ @@ -243,7 +243,7 @@ class ResolverCache * The entry itself. A null value indicates a failed lookup. */ public final Object value; - + /** * The time when this cache entry expires. If set to -1 then * this entry will never expire. If set to 0 then this entry @@ -261,9 +261,9 @@ class ResolverCache int ttl = value != null ? POSITIVE_TTL : NEGATIVE_TTL; if (ttl < 1) - expires = ttl; + expires = ttl; else - expires = System.currentTimeMillis() + ttl * 1000; + expires = System.currentTimeMillis() + ttl * 1000; } } } |