Update exception variable names
Consistently use `ex` for caught exception and `cause` for Exception constructor arguments. Issue gh-8945
This commit is contained in:
@@ -178,8 +178,8 @@ public class FilterChainProxy extends GenericFilterBean {
|
||||
request.setAttribute(FILTER_APPLIED, Boolean.TRUE);
|
||||
doFilterInternal(request, response, chain);
|
||||
}
|
||||
catch (RequestRejectedException e) {
|
||||
this.requestRejectedHandler.handle((HttpServletRequest) request, (HttpServletResponse) response, e);
|
||||
catch (RequestRejectedException ex) {
|
||||
this.requestRejectedHandler.handle((HttpServletRequest) request, (HttpServletResponse) response, ex);
|
||||
}
|
||||
finally {
|
||||
SecurityContextHolder.clearContext();
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ public final class ExpressionBasedFilterInvocationSecurityMetadataSource
|
||||
try {
|
||||
attributes.add(new WebExpressionConfigAttribute(parser.parseExpression(expression), postProcessor));
|
||||
}
|
||||
catch (ParseException e) {
|
||||
catch (ParseException ex) {
|
||||
throw new IllegalArgumentException("Failed to parse expression '" + expression + "'");
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -156,8 +156,8 @@ public class AuthenticationFilter extends OncePerRequestFilter {
|
||||
|
||||
successfulAuthentication(request, response, filterChain, authenticationResult);
|
||||
}
|
||||
catch (AuthenticationException e) {
|
||||
unsuccessfulAuthentication(request, response, e);
|
||||
catch (AuthenticationException ex) {
|
||||
unsuccessfulAuthentication(request, response, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -109,9 +109,9 @@ public abstract class AbstractPreAuthenticatedProcessingFilter extends GenericFi
|
||||
try {
|
||||
super.afterPropertiesSet();
|
||||
}
|
||||
catch (ServletException e) {
|
||||
catch (ServletException ex) {
|
||||
// convert to RuntimeException for passivity on afterPropertiesSet signature
|
||||
throw new RuntimeException(e);
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
Assert.notNull(this.authenticationManager, "An AuthenticationManager must be set");
|
||||
}
|
||||
|
||||
+4
-4
@@ -118,15 +118,15 @@ public class WebXmlMappableAttributesRetriever
|
||||
doc = db.parse(aStream);
|
||||
return doc;
|
||||
}
|
||||
catch (FactoryConfigurationError | IOException | SAXException | ParserConfigurationException e) {
|
||||
throw new RuntimeException("Unable to parse document object", e);
|
||||
catch (FactoryConfigurationError | IOException | SAXException | ParserConfigurationException ex) {
|
||||
throw new RuntimeException("Unable to parse document object", ex);
|
||||
}
|
||||
finally {
|
||||
try {
|
||||
aStream.close();
|
||||
}
|
||||
catch (IOException e) {
|
||||
this.logger.warn("Failed to close input stream for web.xml", e);
|
||||
catch (IOException ex) {
|
||||
this.logger.warn("Failed to close input stream for web.xml", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+20
-20
@@ -137,9 +137,9 @@ final class DefaultWASUsernameAndGroupsExtractor implements WASUsernameAndGroups
|
||||
|
||||
return new ArrayList(groups);
|
||||
}
|
||||
catch (Exception e) {
|
||||
logger.error("Exception occured while looking up groups for user", e);
|
||||
throw new RuntimeException("Exception occured while looking up groups for user", e);
|
||||
catch (Exception ex) {
|
||||
logger.error("Exception occured while looking up groups for user", ex);
|
||||
throw new RuntimeException("Exception occured while looking up groups for user", ex);
|
||||
}
|
||||
finally {
|
||||
try {
|
||||
@@ -147,8 +147,8 @@ final class DefaultWASUsernameAndGroupsExtractor implements WASUsernameAndGroups
|
||||
ic.close();
|
||||
}
|
||||
}
|
||||
catch (NamingException e) {
|
||||
logger.debug("Exception occured while closing context", e);
|
||||
catch (NamingException ex) {
|
||||
logger.debug("Exception occured while closing context", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -157,23 +157,23 @@ final class DefaultWASUsernameAndGroupsExtractor implements WASUsernameAndGroups
|
||||
try {
|
||||
return method.invoke(instance, args);
|
||||
}
|
||||
catch (IllegalArgumentException e) {
|
||||
catch (IllegalArgumentException ex) {
|
||||
logger.error("Error while invoking method " + method.getClass().getName() + "." + method.getName() + "("
|
||||
+ Arrays.asList(args) + ")", e);
|
||||
+ Arrays.asList(args) + ")", ex);
|
||||
throw new RuntimeException("Error while invoking method " + method.getClass().getName() + "."
|
||||
+ method.getName() + "(" + Arrays.asList(args) + ")", e);
|
||||
+ method.getName() + "(" + Arrays.asList(args) + ")", ex);
|
||||
}
|
||||
catch (IllegalAccessException e) {
|
||||
catch (IllegalAccessException ex) {
|
||||
logger.error("Error while invoking method " + method.getClass().getName() + "." + method.getName() + "("
|
||||
+ Arrays.asList(args) + ")", e);
|
||||
+ Arrays.asList(args) + ")", ex);
|
||||
throw new RuntimeException("Error while invoking method " + method.getClass().getName() + "."
|
||||
+ method.getName() + "(" + Arrays.asList(args) + ")", e);
|
||||
+ method.getName() + "(" + Arrays.asList(args) + ")", ex);
|
||||
}
|
||||
catch (InvocationTargetException e) {
|
||||
catch (InvocationTargetException ex) {
|
||||
logger.error("Error while invoking method " + method.getClass().getName() + "." + method.getName() + "("
|
||||
+ Arrays.asList(args) + ")", e);
|
||||
+ Arrays.asList(args) + ")", ex);
|
||||
throw new RuntimeException("Error while invoking method " + method.getClass().getName() + "."
|
||||
+ method.getName() + "(" + Arrays.asList(args) + ")", e);
|
||||
+ method.getName() + "(" + Arrays.asList(args) + ")", ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,14 +187,14 @@ final class DefaultWASUsernameAndGroupsExtractor implements WASUsernameAndGroups
|
||||
}
|
||||
return c.getDeclaredMethod(methodName, parameterTypes);
|
||||
}
|
||||
catch (ClassNotFoundException e) {
|
||||
catch (ClassNotFoundException ex) {
|
||||
logger.error("Required class" + className + " not found");
|
||||
throw new RuntimeException("Required class" + className + " not found", e);
|
||||
throw new RuntimeException("Required class" + className + " not found", ex);
|
||||
}
|
||||
catch (NoSuchMethodException e) {
|
||||
catch (NoSuchMethodException ex) {
|
||||
logger.error("Required method " + methodName + " with parameter types (" + Arrays.asList(parameterTypeNames)
|
||||
+ ") not found on class " + className);
|
||||
throw new RuntimeException("Required class" + className + " not found", e);
|
||||
throw new RuntimeException("Required class" + className + " not found", ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,9 +242,9 @@ final class DefaultWASUsernameAndGroupsExtractor implements WASUsernameAndGroups
|
||||
try {
|
||||
return Class.forName(className);
|
||||
}
|
||||
catch (ClassNotFoundException e) {
|
||||
catch (ClassNotFoundException ex) {
|
||||
logger.error("Required class " + className + " not found");
|
||||
throw new RuntimeException("Required class " + className + " not found", e);
|
||||
throw new RuntimeException("Required class " + className + " not found", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -154,8 +154,8 @@ public abstract class AbstractRememberMeServices implements RememberMeServices,
|
||||
catch (AccountStatusException statusInvalid) {
|
||||
this.logger.debug("Invalid UserDetails: " + statusInvalid.getMessage());
|
||||
}
|
||||
catch (RememberMeAuthenticationException e) {
|
||||
this.logger.debug(e.getMessage());
|
||||
catch (RememberMeAuthenticationException ex) {
|
||||
this.logger.debug(ex.getMessage());
|
||||
}
|
||||
|
||||
cancelCookie(request, response);
|
||||
@@ -219,7 +219,7 @@ public abstract class AbstractRememberMeServices implements RememberMeServices,
|
||||
try {
|
||||
Base64.getDecoder().decode(cookieValue.getBytes());
|
||||
}
|
||||
catch (IllegalArgumentException e) {
|
||||
catch (IllegalArgumentException ex) {
|
||||
throw new InvalidCookieException("Cookie token was not Base64 encoded; value was '" + cookieValue + "'");
|
||||
}
|
||||
|
||||
@@ -231,8 +231,8 @@ public abstract class AbstractRememberMeServices implements RememberMeServices,
|
||||
try {
|
||||
tokens[i] = URLDecoder.decode(tokens[i], StandardCharsets.UTF_8.toString());
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
this.logger.error(e.getMessage(), e);
|
||||
catch (UnsupportedEncodingException ex) {
|
||||
this.logger.error(ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,8 +250,8 @@ public abstract class AbstractRememberMeServices implements RememberMeServices,
|
||||
try {
|
||||
sb.append(URLEncoder.encode(cookieTokens[i], StandardCharsets.UTF_8.toString()));
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
this.logger.error(e.getMessage(), e);
|
||||
catch (UnsupportedEncodingException ex) {
|
||||
this.logger.error(ex.getMessage(), ex);
|
||||
}
|
||||
|
||||
if (i < cookieTokens.length - 1) {
|
||||
|
||||
+2
-2
@@ -100,8 +100,8 @@ public class JdbcTokenRepositoryImpl extends JdbcDaoSupport implements Persisten
|
||||
this.logger.error("Querying token for series '" + seriesId + "' returned more than one value. Series"
|
||||
+ " should be unique");
|
||||
}
|
||||
catch (DataAccessException e) {
|
||||
this.logger.error("Failed to load token for series " + seriesId, e);
|
||||
catch (DataAccessException ex) {
|
||||
this.logger.error("Failed to load token for series " + seriesId, ex);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
+4
-4
@@ -137,8 +137,8 @@ public class PersistentTokenBasedRememberMeServices extends AbstractRememberMeSe
|
||||
this.tokenRepository.updateToken(newToken.getSeries(), newToken.getTokenValue(), newToken.getDate());
|
||||
addCookie(newToken, request, response);
|
||||
}
|
||||
catch (Exception e) {
|
||||
this.logger.error("Failed to update token: ", e);
|
||||
catch (Exception ex) {
|
||||
this.logger.error("Failed to update token: ", ex);
|
||||
throw new RememberMeAuthenticationException("Autologin failed due to data access problem");
|
||||
}
|
||||
|
||||
@@ -163,8 +163,8 @@ public class PersistentTokenBasedRememberMeServices extends AbstractRememberMeSe
|
||||
this.tokenRepository.createNewToken(persistentToken);
|
||||
addCookie(persistentToken, request, response);
|
||||
}
|
||||
catch (Exception e) {
|
||||
this.logger.error("Failed to save persistent token ", e);
|
||||
catch (Exception ex) {
|
||||
this.logger.error("Failed to save persistent token ", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -30,10 +30,10 @@ public class RememberMeAuthenticationException extends AuthenticationException {
|
||||
* Constructs a {@code RememberMeAuthenticationException} with the specified message
|
||||
* and root cause.
|
||||
* @param msg the detail message
|
||||
* @param t the root cause
|
||||
* @param cause the root cause
|
||||
*/
|
||||
public RememberMeAuthenticationException(String msg, Throwable t) {
|
||||
super(msg, t);
|
||||
public RememberMeAuthenticationException(String msg, Throwable cause) {
|
||||
super(msg, cause);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -148,7 +148,7 @@ public class TokenBasedRememberMeServices extends AbstractRememberMeServices {
|
||||
try {
|
||||
digest = MessageDigest.getInstance("MD5");
|
||||
}
|
||||
catch (NoSuchAlgorithmException e) {
|
||||
catch (NoSuchAlgorithmException ex) {
|
||||
throw new IllegalStateException("No MD5 algorithm available!");
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -177,9 +177,9 @@ public class SwitchUserFilter extends GenericFilterBean implements ApplicationEv
|
||||
// redirect to target url
|
||||
this.successHandler.onAuthenticationSuccess(request, response, targetUser);
|
||||
}
|
||||
catch (AuthenticationException e) {
|
||||
this.logger.debug("Switch User failed", e);
|
||||
this.failureHandler.onAuthenticationFailure(request, response, e);
|
||||
catch (AuthenticationException ex) {
|
||||
this.logger.debug("Switch User failed", ex);
|
||||
this.failureHandler.onAuthenticationFailure(request, response, ex);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -310,7 +310,7 @@ public class SwitchUserFilter extends GenericFilterBean implements ApplicationEv
|
||||
// SEC-1763. Check first if we are already switched.
|
||||
currentAuth = attemptExitUser(request);
|
||||
}
|
||||
catch (AuthenticationCredentialsNotFoundException e) {
|
||||
catch (AuthenticationCredentialsNotFoundException ex) {
|
||||
currentAuth = SecurityContextHolder.getContext().getAuthentication();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ public class BasicAuthenticationConverter implements AuthenticationConverter {
|
||||
try {
|
||||
decoded = Base64.getDecoder().decode(base64Token);
|
||||
}
|
||||
catch (IllegalArgumentException e) {
|
||||
catch (IllegalArgumentException ex) {
|
||||
throw new BadCredentialsException("Failed to decode basic authentication token");
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -214,7 +214,7 @@ final class DigestAuthUtils {
|
||||
try {
|
||||
digest = MessageDigest.getInstance("MD5");
|
||||
}
|
||||
catch (NoSuchAlgorithmException e) {
|
||||
catch (NoSuchAlgorithmException ex) {
|
||||
throw new IllegalStateException("No MD5 algorithm available!");
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -135,8 +135,8 @@ public class DigestAuthenticationFilter extends GenericFilterBean implements Mes
|
||||
digestAuth.validateAndDecode(this.authenticationEntryPoint.getKey(),
|
||||
this.authenticationEntryPoint.getRealmName());
|
||||
}
|
||||
catch (BadCredentialsException e) {
|
||||
fail(request, response, e);
|
||||
catch (BadCredentialsException ex) {
|
||||
fail(request, response, ex);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -374,7 +374,7 @@ public class DigestAuthenticationFilter extends GenericFilterBean implements Mes
|
||||
try {
|
||||
Base64.getDecoder().decode(this.nonce.getBytes());
|
||||
}
|
||||
catch (IllegalArgumentException e) {
|
||||
catch (IllegalArgumentException ex) {
|
||||
throw new BadCredentialsException(
|
||||
DigestAuthenticationFilter.this.messages.getMessage("DigestAuthenticationFilter.nonceEncoding",
|
||||
new Object[] { this.nonce }, "Nonce is not encoded in Base64; received nonce {0}"));
|
||||
|
||||
+3
-3
@@ -37,10 +37,10 @@ public class NonceExpiredException extends AuthenticationException {
|
||||
* Constructs a <code>NonceExpiredException</code> with the specified message and root
|
||||
* cause.
|
||||
* @param msg the detail message
|
||||
* @param t root cause
|
||||
* @param cause root cause
|
||||
*/
|
||||
public NonceExpiredException(String msg, Throwable t) {
|
||||
super(msg, t);
|
||||
public NonceExpiredException(String msg, Throwable cause) {
|
||||
super(msg, cause);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -437,7 +437,7 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
|
||||
try {
|
||||
return this.request.getSession(true);
|
||||
}
|
||||
catch (IllegalStateException e) {
|
||||
catch (IllegalStateException ex) {
|
||||
// Response must already be committed, therefore can't create a new
|
||||
// session
|
||||
HttpSessionSecurityContextRepository.this.logger
|
||||
|
||||
+2
-2
@@ -414,8 +414,8 @@ public final class HpkpHeaderWriter implements HeaderWriter {
|
||||
try {
|
||||
this.reportUri = new URI(reportUri);
|
||||
}
|
||||
catch (URISyntaxException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
catch (URISyntaxException ex) {
|
||||
throw new IllegalArgumentException(ex);
|
||||
}
|
||||
updateHpkpHeaderValue();
|
||||
}
|
||||
|
||||
+2
-2
@@ -98,8 +98,8 @@ public class JaasApiIntegrationFilter extends GenericFilterBean {
|
||||
try {
|
||||
Subject.doAs(subject, continueChain);
|
||||
}
|
||||
catch (PrivilegedActionException e) {
|
||||
throw new ServletException(e.getMessage(), e);
|
||||
catch (PrivilegedActionException ex) {
|
||||
throw new ServletException(ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -59,7 +59,7 @@ public class DelegatingServerAuthenticationEntryPoint implements ServerAuthentic
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<Void> commence(ServerWebExchange exchange, AuthenticationException e) {
|
||||
public Mono<Void> commence(ServerWebExchange exchange, AuthenticationException ex) {
|
||||
return Flux.fromIterable(this.entryPoints).filterWhen(entry -> isMatch(exchange, entry)).next()
|
||||
.map(entry -> entry.getEntryPoint()).doOnNext(it -> {
|
||||
if (logger.isDebugEnabled()) {
|
||||
@@ -69,7 +69,7 @@ public class DelegatingServerAuthenticationEntryPoint implements ServerAuthentic
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("No match found. Using default entry point " + this.defaultEntryPoint);
|
||||
}
|
||||
})).flatMap(entryPoint -> entryPoint.commence(exchange, e));
|
||||
})).flatMap(entryPoint -> entryPoint.commence(exchange, ex));
|
||||
}
|
||||
|
||||
private Mono<Boolean> isMatch(ServerWebExchange exchange, DelegateEntry entry) {
|
||||
|
||||
+2
-2
@@ -32,10 +32,10 @@ public interface ServerAuthenticationEntryPoint {
|
||||
/**
|
||||
* Initiates the authentication flow
|
||||
* @param exchange
|
||||
* @param e
|
||||
* @param ex
|
||||
* @return {@code Mono<Void>} to indicate when the request for authentication is
|
||||
* complete
|
||||
*/
|
||||
Mono<Void> commence(ServerWebExchange exchange, AuthenticationException e);
|
||||
Mono<Void> commence(ServerWebExchange exchange, AuthenticationException ex);
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ public class ServerHttpBasicAuthenticationConverter implements Function<ServerWe
|
||||
try {
|
||||
return Base64.getDecoder().decode(value);
|
||||
}
|
||||
catch (Exception e) {
|
||||
catch (Exception ex) {
|
||||
return new byte[0];
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public class HttpBasicServerAuthenticationEntryPoint implements ServerAuthentica
|
||||
private String headerValue = createHeaderValue(DEFAULT_REALM);
|
||||
|
||||
@Override
|
||||
public Mono<Void> commence(ServerWebExchange exchange, AuthenticationException e) {
|
||||
public Mono<Void> commence(ServerWebExchange exchange, AuthenticationException ex) {
|
||||
return Mono.fromRunnable(() -> {
|
||||
ServerHttpResponse response = exchange.getResponse();
|
||||
response.setStatusCode(HttpStatus.UNAUTHORIZED);
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ public class RedirectServerAuthenticationEntryPoint implements ServerAuthenticat
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<Void> commence(ServerWebExchange exchange, AuthenticationException e) {
|
||||
public Mono<Void> commence(ServerWebExchange exchange, AuthenticationException ex) {
|
||||
return this.requestCache.saveRequest(exchange)
|
||||
.then(this.redirectStrategy.sendRedirect(exchange, this.location));
|
||||
}
|
||||
|
||||
+2
-2
@@ -49,12 +49,12 @@ public class HttpStatusServerAccessDeniedHandler implements ServerAccessDeniedHa
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<Void> handle(ServerWebExchange exchange, AccessDeniedException e) {
|
||||
public Mono<Void> handle(ServerWebExchange exchange, AccessDeniedException ex) {
|
||||
return Mono.defer(() -> Mono.just(exchange.getResponse())).flatMap(response -> {
|
||||
response.setStatusCode(this.httpStatus);
|
||||
response.getHeaders().setContentType(MediaType.TEXT_PLAIN);
|
||||
DataBufferFactory dataBufferFactory = response.bufferFactory();
|
||||
DataBuffer buffer = dataBufferFactory.wrap(e.getMessage().getBytes(Charset.defaultCharset()));
|
||||
DataBuffer buffer = dataBufferFactory.wrap(ex.getMessage().getBytes(Charset.defaultCharset()));
|
||||
return response.writeWith(Mono.just(buffer)).doOnError(error -> DataBufferUtils.release(buffer));
|
||||
});
|
||||
}
|
||||
|
||||
+2
-2
@@ -76,8 +76,8 @@ public class MediaTypeServerWebExchangeMatcher implements ServerWebExchangeMatch
|
||||
try {
|
||||
httpRequestMediaTypes = resolveMediaTypes(exchange);
|
||||
}
|
||||
catch (NotAcceptableStatusException e) {
|
||||
this.logger.debug("Failed to parse MediaTypes, returning false", e);
|
||||
catch (NotAcceptableStatusException ex) {
|
||||
this.logger.debug("Failed to parse MediaTypes, returning false", ex);
|
||||
return MatchResult.notMatch();
|
||||
}
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ public class MvcRequestMatcher implements RequestMatcher, RequestVariablesExtrac
|
||||
try {
|
||||
return this.introspector.getMatchableHandlerMapping(request);
|
||||
}
|
||||
catch (Throwable t) {
|
||||
catch (Throwable ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -95,11 +95,11 @@ public class SessionManagementFilter extends GenericFilterBean {
|
||||
try {
|
||||
this.sessionAuthenticationStrategy.onAuthentication(authentication, request, response);
|
||||
}
|
||||
catch (SessionAuthenticationException e) {
|
||||
catch (SessionAuthenticationException ex) {
|
||||
// The session strategy can reject the authentication
|
||||
this.logger.debug("SessionAuthenticationStrategy rejected the authentication object", e);
|
||||
this.logger.debug("SessionAuthenticationStrategy rejected the authentication object", ex);
|
||||
SecurityContextHolder.clearContext();
|
||||
this.failureHandler.onAuthenticationFailure(request, response, e);
|
||||
this.failureHandler.onAuthenticationFailure(request, response, ex);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
+1
-1
@@ -249,7 +249,7 @@ public final class AntPathRequestMatcher implements RequestMatcher, RequestVaria
|
||||
try {
|
||||
return HttpMethod.valueOf(method);
|
||||
}
|
||||
catch (IllegalArgumentException e) {
|
||||
catch (IllegalArgumentException ex) {
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
+2
-2
@@ -101,8 +101,8 @@ public final class IpAddressMatcher implements RequestMatcher {
|
||||
try {
|
||||
return InetAddress.getByName(address);
|
||||
}
|
||||
catch (UnknownHostException e) {
|
||||
throw new IllegalArgumentException("Failed to parse address" + address, e);
|
||||
catch (UnknownHostException ex) {
|
||||
throw new IllegalArgumentException("Failed to parse address" + address, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -201,8 +201,8 @@ public final class MediaTypeRequestMatcher implements RequestMatcher {
|
||||
try {
|
||||
httpRequestMediaTypes = this.contentNegotiationStrategy.resolveMediaTypes(new ServletWebRequest(request));
|
||||
}
|
||||
catch (HttpMediaTypeNotAcceptableException e) {
|
||||
this.logger.debug("Failed to parse MediaTypes, returning false", e);
|
||||
catch (HttpMediaTypeNotAcceptableException ex) {
|
||||
this.logger.debug("Failed to parse MediaTypes, returning false", ex);
|
||||
return false;
|
||||
}
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@ public final class RegexRequestMatcher implements RequestMatcher {
|
||||
try {
|
||||
return HttpMethod.valueOf(method);
|
||||
}
|
||||
catch (IllegalArgumentException e) {
|
||||
catch (IllegalArgumentException ex) {
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
+2
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ public class UsernamePasswordAuthenticationFilterTests {
|
||||
filter.attemptAuthentication(request, new MockHttpServletResponse());
|
||||
fail("Expected AuthenticationException");
|
||||
}
|
||||
catch (AuthenticationException e) {
|
||||
catch (AuthenticationException ex) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user