X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cadi%2Fclient%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fcadi%2Flocator%2FDNSLocator.java;h=f6edfd1d57f3f497b7a851579385d942e4690365;hb=refs%2Fchanges%2F67%2F99867%2F1;hp=53782b3469db499e8e6931e85adb1a2d609a4c0d;hpb=3ca2e6964bf2aab93394cf542b6354ca735703c0;p=aaf%2Fauthz.git diff --git a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/DNSLocator.java b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/DNSLocator.java index 53782b34..f6edfd1d 100644 --- a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/DNSLocator.java +++ b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/DNSLocator.java @@ -103,10 +103,12 @@ public class DNSLocator implements SizedLocator { @Override public boolean hasItems() { - for (Host h : hosts) { + if(hosts!=null) { + for (Host h : hosts) { if (h.status==Status.OK) { return true; } + } } return false; } @@ -239,11 +241,11 @@ public class DNSLocator implements SizedLocator { * */ public interface DNSLookup { - InetAddress[] getAllByName(String host) throws UnknownHostException; - public static final DNSLookup dflt = new DNSLookup() { - public InetAddress[] getAllByName(String host) throws UnknownHostException { - return InetAddress.getAllByName(host); - } + InetAddress[] getAllByName(String host) throws UnknownHostException; + public static final DNSLookup dflt = new DNSLookup() { + public InetAddress[] getAllByName(String host) throws UnknownHostException { + return InetAddress.getAllByName(host); + } }; }