avoid java 7 api

This commit is contained in:
Noah Levitt
2014-10-01 13:38:14 -07:00
parent 6faa1b8c1c
commit 060054e6b3
@@ -21,6 +21,7 @@ package org.archive.modules.fetcher;
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Set;
import javax.servlet.ServletException;
@@ -165,7 +166,14 @@ public class CookieFetchHTTPIntegrationTest extends ProcessorTestBase {
}
public static class AlwaysLocalhostServerCache extends ServerCache {
protected static final InetAddress LOCALHOST = InetAddress.getLoopbackAddress();
protected static final InetAddress LOCALHOST;
static {
try {
LOCALHOST = InetAddress.getByName("127.0.0.1");
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
}
@Override
public CrawlHost getHostFor(String host) {