remove never used Domains.myHostNames set

pull/51/head
reger 9 years ago
parent 6ecc180299
commit 3adb670f44

@ -100,12 +100,10 @@ public class Domains {
private static Set<InetAddress> localHostAddresses = new HashSet<InetAddress>(); // subset of myHostAddresses private static Set<InetAddress> localHostAddresses = new HashSet<InetAddress>(); // subset of myHostAddresses
private static Set<InetAddress> publicIPv4HostAddresses = new HashSet<InetAddress>(); // subset of myHostAddresses private static Set<InetAddress> publicIPv4HostAddresses = new HashSet<InetAddress>(); // subset of myHostAddresses
private static Set<InetAddress> publicIPv6HostAddresses = new HashSet<InetAddress>(); // subset of myHostAddresses private static Set<InetAddress> publicIPv6HostAddresses = new HashSet<InetAddress>(); // subset of myHostAddresses
private static Set<String> myHostNames = new HashSet<String>();
private static Set<String> localHostNames = new HashSet<String>(); // subset of myHostNames private static Set<String> localHostNames = new HashSet<String>(); // subset of myHostNames
private static Set<String> publicIPv4HostNames = new HashSet<String>(); // subset of myHostNames private static Set<String> publicIPv4HostNames = new HashSet<String>(); // subset of myHostNames
private static Set<String> publicIPv6HostNames = new HashSet<String>(); // subset of myHostNames private static Set<String> publicIPv6HostNames = new HashSet<String>(); // subset of myHostNames
static { static {
myHostNames.add(LOCALHOST);
localHostNames.add(LOCALHOST); localHostNames.add(LOCALHOST);
try { try {
InetAddress localHostAddress = InetAddress.getLocalHost(); InetAddress localHostAddress = InetAddress.getLocalHost();
@ -166,8 +164,6 @@ public class Domains {
} }
hns.add(hostaddressP); hns.add(hostaddressP);
final String hostname = getHostName(a); final String hostname = getHostName(a);
if (hostname != null) myHostNames.add(hostname);
myHostNames.addAll(hns);
for (String hostaddress: hns) { for (String hostaddress: hns) {
if (hostaddress.contains("::0:") || hostaddress.contains(":0::")) continue; // not common (but possible); we skip that if (hostaddress.contains("::0:") || hostaddress.contains(":0::")) continue; // not common (but possible); we skip that
// we write the local tests into variables to be able to debug these values // we write the local tests into variables to be able to debug these values
@ -986,9 +982,7 @@ public class Domains {
// add also the isLocal host name caches // add also the isLocal host name caches
final boolean localp = ip.isAnyLocalAddress() || ip.isLinkLocalAddress() || ip.isSiteLocalAddress(); final boolean localp = ip.isAnyLocalAddress() || ip.isLinkLocalAddress() || ip.isSiteLocalAddress();
if (localp) { if (!localp) {
myHostNames.add(host);
} else {
if (globalHosts != null) try { if (globalHosts != null) try {
globalHosts.add(host); globalHosts.add(host);
} catch (final IOException e) {} } catch (final IOException e) {}

Loading…
Cancel
Save