1
0
mirror of synced 2026-05-22 13:23:17 +00:00

Update exception variable names

Consistently use `ex` for caught exception and `cause` for Exception
constructor arguments.

Issue gh-8945
This commit is contained in:
Phillip Webb
2020-07-28 23:53:30 -07:00
committed by Rob Winch
parent e9130489a6
commit 8d80166aaf
194 changed files with 635 additions and 633 deletions
@@ -80,8 +80,8 @@ public class JndiDnsResolver implements DnsResolver {
// only the first.
return dnsRecord.get().toString();
}
catch (NamingException e) {
throw new DnsLookupException("DNS lookup failed for: " + hostname, e);
catch (NamingException ex) {
throw new DnsLookupException("DNS lookup failed for: " + hostname, ex);
}
}
@@ -120,8 +120,8 @@ public class JndiDnsResolver implements DnsResolver {
}
}
}
catch (NamingException e) {
throw new DnsLookupException("DNS lookup failed for service " + serviceType + " at " + domain, e);
catch (NamingException ex) {
throw new DnsLookupException("DNS lookup failed for service " + serviceType + " at " + domain, ex);
}
// remove the "." at the end
@@ -137,11 +137,11 @@ public class JndiDnsResolver implements DnsResolver {
return dnsResult.get(recordType);
}
catch (NamingException e) {
if (e instanceof NameNotFoundException) {
throw new DnsEntryNotFoundException("DNS entry not found for:" + query, e);
catch (NamingException ex) {
if (ex instanceof NameNotFoundException) {
throw new DnsEntryNotFoundException("DNS entry not found for:" + query, ex);
}
throw new DnsLookupException("DNS lookup failed for: " + query, e);
throw new DnsLookupException("DNS lookup failed for: " + query, ex);
}
}
@@ -156,8 +156,8 @@ public class JndiDnsResolver implements DnsResolver {
try {
ictx = new InitialDirContext(env);
}
catch (NamingException e) {
throw new DnsLookupException("Cannot create InitialDirContext for DNS lookup", e);
catch (NamingException ex) {
throw new DnsLookupException("Cannot create InitialDirContext for DNS lookup", ex);
}
return ictx;
}
@@ -69,7 +69,7 @@ public class ContextPropagatingRemoteInvocationTests {
remoteInvocation.invoke(TargetObject.class.newInstance());
fail("Expected IllegalArgumentException");
}
catch (IllegalArgumentException e) {
catch (IllegalArgumentException ex) {
// expected
}