8075378: JNDI DnsClient Exception Handling

Reviewed-by: chegar
This commit is contained in:
Vinnie Ryan 2015-04-10 16:43:39 +01:00
parent e63cd605f3
commit d0be3332e5

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -184,6 +184,7 @@ public class DnsClient {
Exception caughtException = null;
boolean[] doNotRetry = new boolean[servers.length];
try {
//
// The UDP retry strategy is to try the 1st server, and then
// each server in order. If no answer, double the timeout
@ -282,6 +283,7 @@ public class DnsClient {
doNotRetry[i] = true;
}
} catch (NameNotFoundException e) {
// This is authoritative, so return immediately
throw e;
} catch (CommunicationException e) {
if (caughtException == null) {
@ -296,7 +298,10 @@ public class DnsClient {
} // servers
} // retries
reqs.remove(xid);
} finally {
reqs.remove(xid); // cleanup
}
if (caughtException instanceof NamingException) {
throw (NamingException) caughtException;
}