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

View File

@@ -240,11 +240,11 @@ public class AuthenticationFilterTests {
try {
filter.doFilter(request, response, chain);
}
catch (ServletException e) {
catch (ServletException ex) {
verifyZeroInteractions(this.successHandler);
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
throw e;
throw ex;
}
}

View File

@@ -129,7 +129,7 @@ public class UsernamePasswordAuthenticationFilterTests {
filter.attemptAuthentication(request, new MockHttpServletResponse());
fail("Expected AuthenticationException");
}
catch (AuthenticationException e) {
catch (AuthenticationException ex) {
}
}

View File

@@ -69,8 +69,8 @@ public class HttpStatusReturningLogoutSuccessHandlerTests {
try {
new HttpStatusReturningLogoutSuccessHandler(null);
}
catch (IllegalArgumentException e) {
assertThat(e).hasMessage("The provided HttpStatus must not be null.");
catch (IllegalArgumentException ex) {
assertThat(ex).hasMessage("The provided HttpStatus must not be null.");
return;
}

View File

@@ -38,8 +38,8 @@ public class Http403ForbiddenEntryPointTests {
assertThat(resp.getStatus()).withFailMessage("Incorrect status")
.isEqualTo(HttpServletResponse.SC_FORBIDDEN);
}
catch (IOException e) {
fail("Unexpected exception thrown: " + e);
catch (IOException ex) {
fail("Unexpected exception thrown: " + ex);
}
}

View File

@@ -96,7 +96,7 @@ public class ThrowableAnalyzerTests {
fail("IllegalArgumentExpected");
}
catch (IllegalArgumentException e) {
catch (IllegalArgumentException ex) {
// ok
}
}
@@ -231,7 +231,7 @@ public class ThrowableAnalyzerTests {
ThrowableAnalyzer.verifyThrowableHierarchy(null, Throwable.class);
fail("IllegalArgumentException expected");
}
catch (IllegalArgumentException e) {
catch (IllegalArgumentException ex) {
// ok
}
}
@@ -244,7 +244,7 @@ public class ThrowableAnalyzerTests {
ThrowableAnalyzer.verifyThrowableHierarchy(throwable, InvocationTargetException.class);
fail("IllegalArgumentException expected");
}
catch (IllegalArgumentException e) {
catch (IllegalArgumentException ex) {
// ok
}
}