From 592068e7cf06efa4803530e6ae55ea102dd7330c Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 27 Mar 2014 14:41:01 +0100 Subject: code cleanup --- src/eu/siacs/conversations/utils/DNSHelper.java | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'src/eu') diff --git a/src/eu/siacs/conversations/utils/DNSHelper.java b/src/eu/siacs/conversations/utils/DNSHelper.java index 5ed9d9f5..dbdd2648 100644 --- a/src/eu/siacs/conversations/utils/DNSHelper.java +++ b/src/eu/siacs/conversations/utils/DNSHelper.java @@ -29,24 +29,17 @@ public class DNSHelper { if (value != null && !"".equals(value) && !servers.contains(value)) { ip = InetAddress.getByName(value); - servers.add(value); - Bundle result = queryDNS(host, ip); - if (!result.containsKey("error")) { - return result; - } + servers.add(value); + Bundle result = queryDNS(host, ip); + if (!result.containsKey("error")) { + return result; + } } } - } catch (ClassNotFoundException e) { - ip = InetAddress.getByName("8.8.8.8"); - } catch (NoSuchMethodException e) { - ip = InetAddress.getByName("8.8.8.8"); - } catch (IllegalAccessException e) { - ip = InetAddress.getByName("8.8.8.8"); - } catch (IllegalArgumentException e) { - ip = InetAddress.getByName("8.8.8.8"); - } catch (InvocationTargetException e) { - ip = InetAddress.getByName("8.8.8.8"); + } catch (Exception e) { + Log.d("xmppService","error during system calls"); } + ip = InetAddress.getByName("8.8.8.8"); return queryDNS(host, ip); } @@ -90,7 +83,6 @@ public class DNSHelper { datagramSocket.setSoTimeout(3000); datagramSocket.receive(receivePacket); if (receiveData[3] != -128) { - Log.d("xmppService", "not the right count"); namePort.putString("error", "nosrv"); return namePort; } -- cgit v1.2.3