diff --git a/acl/src/main/java/org/springframework/security/acls/domain/IdentityUnavailableException.java b/acl/src/main/java/org/springframework/security/acls/domain/IdentityUnavailableException.java
index 872b36bbf1a..ab53988f52e 100644
--- a/acl/src/main/java/org/springframework/security/acls/domain/IdentityUnavailableException.java
+++ b/acl/src/main/java/org/springframework/security/acls/domain/IdentityUnavailableException.java
@@ -34,10 +34,10 @@ public IdentityUnavailableException(String msg) {
* Constructs an IdentityUnavailableException
with the specified message
* and root cause.
* @param msg the detail message
- * @param t root cause
+ * @param cause root cause
*/
- public IdentityUnavailableException(String msg, Throwable t) {
- super(msg, t);
+ public IdentityUnavailableException(String msg, Throwable cause) {
+ super(msg, cause);
}
}
diff --git a/acl/src/main/java/org/springframework/security/acls/domain/ObjectIdentityImpl.java b/acl/src/main/java/org/springframework/security/acls/domain/ObjectIdentityImpl.java
index 727e81ee777..4c64e995e46 100644
--- a/acl/src/main/java/org/springframework/security/acls/domain/ObjectIdentityImpl.java
+++ b/acl/src/main/java/org/springframework/security/acls/domain/ObjectIdentityImpl.java
@@ -77,8 +77,8 @@ public ObjectIdentityImpl(Object object) throws IdentityUnavailableException {
Method method = typeClass.getMethod("getId", new Class[] {});
result = method.invoke(object);
}
- catch (Exception e) {
- throw new IdentityUnavailableException("Could not extract identity from object " + object, e);
+ catch (Exception ex) {
+ throw new IdentityUnavailableException("Could not extract identity from object " + object, ex);
}
Assert.notNull(result, "getId() is required to return a non-null value");
diff --git a/acl/src/main/java/org/springframework/security/acls/jdbc/AclClassIdUtils.java b/acl/src/main/java/org/springframework/security/acls/jdbc/AclClassIdUtils.java
index d8b4ca75550..fc311910cd3 100644
--- a/acl/src/main/java/org/springframework/security/acls/jdbc/AclClassIdUtils.java
+++ b/acl/src/main/java/org/springframework/security/acls/jdbc/AclClassIdUtils.java
@@ -85,8 +85,8 @@ private boolean hasValidClassIdType(ResultSet resultSet) {
try {
hasClassIdType = classIdTypeFrom(resultSet) != null;
}
- catch (SQLException e) {
- log.debug("Unable to obtain the class id type", e);
+ catch (SQLException ex) {
+ log.debug("Unable to obtain the class id type", ex);
}
return hasClassIdType;
}
@@ -101,8 +101,8 @@ private Class classIdTypeFrom(String className) {
try {
targetType = Class.forName(className);
}
- catch (ClassNotFoundException e) {
- log.debug("Unable to find class id type on classpath", e);
+ catch (ClassNotFoundException ex) {
+ log.debug("Unable to find class id type on classpath", ex);
}
}
return targetType;
diff --git a/acl/src/main/java/org/springframework/security/acls/jdbc/BasicLookupStrategy.java b/acl/src/main/java/org/springframework/security/acls/jdbc/BasicLookupStrategy.java
index 1b89d89c479..2faaeb2ac0c 100644
--- a/acl/src/main/java/org/springframework/security/acls/jdbc/BasicLookupStrategy.java
+++ b/acl/src/main/java/org/springframework/security/acls/jdbc/BasicLookupStrategy.java
@@ -194,8 +194,8 @@ private List readAces(AclImpl acl) {
try {
return (List) this.fieldAces.get(acl);
}
- catch (IllegalAccessException e) {
- throw new IllegalStateException("Could not obtain AclImpl.aces field", e);
+ catch (IllegalAccessException ex) {
+ throw new IllegalStateException("Could not obtain AclImpl.aces field", ex);
}
}
@@ -203,8 +203,8 @@ private void setAclOnAce(AccessControlEntryImpl ace, AclImpl acl) {
try {
this.fieldAcl.set(ace, acl);
}
- catch (IllegalAccessException e) {
- throw new IllegalStateException("Could not or set AclImpl on AccessControlEntryImpl fields", e);
+ catch (IllegalAccessException ex) {
+ throw new IllegalStateException("Could not or set AclImpl on AccessControlEntryImpl fields", ex);
}
}
@@ -212,8 +212,8 @@ private void setAces(AclImpl acl, List aces) {
try {
this.fieldAces.set(acl, aces);
}
- catch (IllegalAccessException e) {
- throw new IllegalStateException("Could not set AclImpl entries", e);
+ catch (IllegalAccessException ex) {
+ throw new IllegalStateException("Could not set AclImpl entries", ex);
}
}
diff --git a/acl/src/main/java/org/springframework/security/acls/model/AlreadyExistsException.java b/acl/src/main/java/org/springframework/security/acls/model/AlreadyExistsException.java
index 1646f53e0be..a8b3130f464 100644
--- a/acl/src/main/java/org/springframework/security/acls/model/AlreadyExistsException.java
+++ b/acl/src/main/java/org/springframework/security/acls/model/AlreadyExistsException.java
@@ -34,10 +34,10 @@ public AlreadyExistsException(String msg) {
* Constructs an AlreadyExistsException
with the specified message and
* root cause.
* @param msg the detail message
- * @param t root cause
+ * @param cause root cause
*/
- public AlreadyExistsException(String msg, Throwable t) {
- super(msg, t);
+ public AlreadyExistsException(String msg, Throwable cause) {
+ super(msg, cause);
}
}
diff --git a/acl/src/main/java/org/springframework/security/acls/model/ChildrenExistException.java b/acl/src/main/java/org/springframework/security/acls/model/ChildrenExistException.java
index 679112393c9..fca77474ff1 100644
--- a/acl/src/main/java/org/springframework/security/acls/model/ChildrenExistException.java
+++ b/acl/src/main/java/org/springframework/security/acls/model/ChildrenExistException.java
@@ -34,10 +34,10 @@ public ChildrenExistException(String msg) {
* Constructs an ChildrenExistException
with the specified message and
* root cause.
* @param msg the detail message
- * @param t root cause
+ * @param cause root cause
*/
- public ChildrenExistException(String msg, Throwable t) {
- super(msg, t);
+ public ChildrenExistException(String msg, Throwable cause) {
+ super(msg, cause);
}
}
diff --git a/acl/src/main/java/org/springframework/security/acls/model/NotFoundException.java b/acl/src/main/java/org/springframework/security/acls/model/NotFoundException.java
index a77e2521260..9f738f7cc22 100644
--- a/acl/src/main/java/org/springframework/security/acls/model/NotFoundException.java
+++ b/acl/src/main/java/org/springframework/security/acls/model/NotFoundException.java
@@ -34,10 +34,10 @@ public NotFoundException(String msg) {
* Constructs an NotFoundException
with the specified message and root
* cause.
* @param msg the detail message
- * @param t root cause
+ * @param cause root cause
*/
- public NotFoundException(String msg, Throwable t) {
- super(msg, t);
+ public NotFoundException(String msg, Throwable cause) {
+ super(msg, cause);
}
}
diff --git a/acl/src/main/java/org/springframework/security/acls/model/UnloadedSidException.java b/acl/src/main/java/org/springframework/security/acls/model/UnloadedSidException.java
index 68f68b6c423..fd95557ab26 100644
--- a/acl/src/main/java/org/springframework/security/acls/model/UnloadedSidException.java
+++ b/acl/src/main/java/org/springframework/security/acls/model/UnloadedSidException.java
@@ -36,10 +36,10 @@ public UnloadedSidException(String msg) {
* Constructs an NotFoundException
with the specified message and root
* cause.
* @param msg the detail message
- * @param t root cause
+ * @param cause root cause
*/
- public UnloadedSidException(String msg, Throwable t) {
- super(msg, t);
+ public UnloadedSidException(String msg, Throwable cause) {
+ super(msg, cause);
}
}
diff --git a/acl/src/test/java/org/springframework/security/acls/domain/AclImplTests.java b/acl/src/test/java/org/springframework/security/acls/domain/AclImplTests.java
index cb33e618ca6..b4647f3ded1 100644
--- a/acl/src/test/java/org/springframework/security/acls/domain/AclImplTests.java
+++ b/acl/src/test/java/org/springframework/security/acls/domain/AclImplTests.java
@@ -628,8 +628,8 @@ public MutableAcl updateAcl(MutableAcl acl) throws NotFoundException {
((AuditableAccessControlEntry) ac).isAuditFailure()));
}
}
- catch (IllegalAccessException e) {
- e.printStackTrace();
+ catch (IllegalAccessException ex) {
+ ex.printStackTrace();
}
return acl;
diff --git a/acl/src/test/java/org/springframework/security/acls/jdbc/JdbcMutableAclServiceTests.java b/acl/src/test/java/org/springframework/security/acls/jdbc/JdbcMutableAclServiceTests.java
index d0f964ec0df..5a43cd8d54f 100644
--- a/acl/src/test/java/org/springframework/security/acls/jdbc/JdbcMutableAclServiceTests.java
+++ b/acl/src/test/java/org/springframework/security/acls/jdbc/JdbcMutableAclServiceTests.java
@@ -121,9 +121,9 @@ public void createTables() throws Exception {
// new DatabaseSeeder(dataSource, new
// ClassPathResource("createAclSchemaPostgres.sql"));
}
- catch (Exception e) {
- e.printStackTrace();
- throw e;
+ catch (Exception ex) {
+ ex.printStackTrace();
+ throw ex;
}
}
diff --git a/cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationProvider.java b/cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationProvider.java
index 48eaaeeca63..17ff6d98ec8 100644
--- a/cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationProvider.java
+++ b/cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationProvider.java
@@ -156,8 +156,8 @@ private CasAuthenticationToken authenticateNow(final Authentication authenticati
return new CasAuthenticationToken(this.key, userDetails, authentication.getCredentials(),
this.authoritiesMapper.mapAuthorities(userDetails.getAuthorities()), userDetails, assertion);
}
- catch (final TicketValidationException e) {
- throw new BadCredentialsException(e.getMessage(), e);
+ catch (TicketValidationException ex) {
+ throw new BadCredentialsException(ex.getMessage(), ex);
}
}
diff --git a/cas/src/main/java/org/springframework/security/cas/web/authentication/ServiceAuthenticationDetailsSource.java b/cas/src/main/java/org/springframework/security/cas/web/authentication/ServiceAuthenticationDetailsSource.java
index 336fe142aa4..530fae36c32 100644
--- a/cas/src/main/java/org/springframework/security/cas/web/authentication/ServiceAuthenticationDetailsSource.java
+++ b/cas/src/main/java/org/springframework/security/cas/web/authentication/ServiceAuthenticationDetailsSource.java
@@ -74,8 +74,8 @@ public ServiceAuthenticationDetails buildDetails(HttpServletRequest context) {
return new DefaultServiceAuthenticationDetails(this.serviceProperties.getService(), context,
this.artifactPattern);
}
- catch (MalformedURLException e) {
- throw new RuntimeException(e);
+ catch (MalformedURLException ex) {
+ throw new RuntimeException(ex);
}
}
diff --git a/config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java b/config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java
index 76f47b51cb4..d2406394928 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java
@@ -102,8 +102,8 @@ public O getOrBuild() {
try {
return build();
}
- catch (Exception e) {
- this.logger.debug("Failed to perform build. Returning null", e);
+ catch (Exception ex) {
+ this.logger.debug("Failed to perform build. Returning null", ex);
return null;
}
}
diff --git a/config/src/main/java/org/springframework/security/config/annotation/authentication/configurers/ldap/LdapAuthenticationProviderConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/authentication/configurers/ldap/LdapAuthenticationProviderConfigurer.java
index 0db78b0c522..69161becf0b 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/authentication/configurers/ldap/LdapAuthenticationProviderConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/authentication/configurers/ldap/LdapAuthenticationProviderConfigurer.java
@@ -595,7 +595,7 @@ private int getDefaultPort() {
try (ServerSocket serverSocket = new ServerSocket(DEFAULT_PORT)) {
return serverSocket.getLocalPort();
}
- catch (IOException e) {
+ catch (IOException ex) {
return RANDOM_PORT;
}
}
diff --git a/config/src/main/java/org/springframework/security/config/annotation/configuration/AutowireBeanFactoryObjectPostProcessor.java b/config/src/main/java/org/springframework/security/config/annotation/configuration/AutowireBeanFactoryObjectPostProcessor.java
index 458715e894b..6799a7113fd 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/configuration/AutowireBeanFactoryObjectPostProcessor.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/configuration/AutowireBeanFactoryObjectPostProcessor.java
@@ -63,9 +63,9 @@ public T postProcess(T object) {
try {
result = (T) this.autowireBeanFactory.initializeBean(object, object.toString());
}
- catch (RuntimeException e) {
+ catch (RuntimeException ex) {
Class> type = object.getClass();
- throw new RuntimeException("Could not postProcess " + object + " of type " + type, e);
+ throw new RuntimeException("Could not postProcess " + object + " of type " + type, ex);
}
this.autowireBeanFactory.autowireBean(object);
if (result instanceof DisposableBean) {
diff --git a/config/src/main/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.java b/config/src/main/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.java
index 5748ed77732..4b4bf3c503d 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.java
@@ -153,8 +153,8 @@ public void afterSingletonsInstantiated() {
try {
initializeMethodSecurityInterceptor();
}
- catch (Exception e) {
- throw new RuntimeException(e);
+ catch (Exception ex) {
+ throw new RuntimeException(ex);
}
PermissionEvaluator permissionEvaluator = getSingleBeanOrNull(PermissionEvaluator.class);
@@ -182,7 +182,7 @@ private T getSingleBeanOrNull(Class type) {
try {
return this.context.getBean(type);
}
- catch (NoSuchBeanDefinitionException e) {
+ catch (NoSuchBeanDefinitionException ex) {
}
return null;
}
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/builders/WebSecurity.java b/config/src/main/java/org/springframework/security/config/annotation/web/builders/WebSecurity.java
index 1a42d578496..e35182977b2 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/builders/WebSecurity.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/builders/WebSecurity.java
@@ -311,26 +311,26 @@ public void setApplicationContext(ApplicationContext applicationContext) throws
try {
this.defaultWebSecurityExpressionHandler.setRoleHierarchy(applicationContext.getBean(RoleHierarchy.class));
}
- catch (NoSuchBeanDefinitionException e) {
+ catch (NoSuchBeanDefinitionException ex) {
}
try {
this.defaultWebSecurityExpressionHandler
.setPermissionEvaluator(applicationContext.getBean(PermissionEvaluator.class));
}
- catch (NoSuchBeanDefinitionException e) {
+ catch (NoSuchBeanDefinitionException ex) {
}
this.ignoredRequestRegistry = new IgnoredRequestConfigurer(applicationContext);
try {
this.httpFirewall = applicationContext.getBean(HttpFirewall.class);
}
- catch (NoSuchBeanDefinitionException e) {
+ catch (NoSuchBeanDefinitionException ex) {
}
try {
this.requestRejectedHandler = applicationContext.getBean(RequestRejectedHandler.class);
}
- catch (NoSuchBeanDefinitionException e) {
+ catch (NoSuchBeanDefinitionException ex) {
}
}
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configuration/SecurityReactorContextConfiguration.java b/config/src/main/java/org/springframework/security/config/annotation/web/configuration/SecurityReactorContextConfiguration.java
index 71f00115b33..3de9f90ccb6 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configuration/SecurityReactorContextConfiguration.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configuration/SecurityReactorContextConfiguration.java
@@ -165,8 +165,8 @@ public void onNext(T t) {
}
@Override
- public void onError(Throwable t) {
- this.delegate.onError(t);
+ public void onError(Throwable ex) {
+ this.delegate.onError(ex);
}
@Override
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/RequestCacheConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/RequestCacheConfigurer.java
index b74c57c3baa..71965d88c45 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/RequestCacheConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/RequestCacheConfigurer.java
@@ -136,7 +136,7 @@ private T getBeanOrNull(Class type) {
try {
return context.getBean(type);
}
- catch (NoSuchBeanDefinitionException e) {
+ catch (NoSuchBeanDefinitionException ex) {
return null;
}
}
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurer.java
index c38d6fbc967..12a0fccc895 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/SessionManagementConfigurer.java
@@ -560,7 +560,7 @@ private T getBeanOrNull(Class type) {
try {
return context.getBean(type);
}
- catch (NoSuchBeanDefinitionException e) {
+ catch (NoSuchBeanDefinitionException ex) {
return null;
}
}
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurer.java
index e73875032d1..2ae3b43bce0 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurer.java
@@ -506,7 +506,7 @@ public boolean matches(HttpServletRequest request) {
try {
return this.bearerTokenResolver.resolve(request) != null;
}
- catch (OAuth2AuthenticationException e) {
+ catch (OAuth2AuthenticationException ex) {
return false;
}
}
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurer.java
index afdc1d39097..7811cb40e4f 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurer.java
@@ -325,7 +325,7 @@ private C getBeanOrNull(B http, Class clazz) {
try {
return context.getBean(clazz);
}
- catch (NoSuchBeanDefinitionException e) {
+ catch (NoSuchBeanDefinitionException ex) {
}
return null;
}
diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/socket/AbstractSecurityWebSocketMessageBrokerConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/socket/AbstractSecurityWebSocketMessageBrokerConfigurer.java
index 4e2334e98e5..243b26b52ad 100644
--- a/config/src/main/java/org/springframework/security/config/annotation/web/socket/AbstractSecurityWebSocketMessageBrokerConfigurer.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/socket/AbstractSecurityWebSocketMessageBrokerConfigurer.java
@@ -119,7 +119,7 @@ private PathMatcher getDefaultPathMatcher() {
try {
return this.context.getBean(SimpAnnotationMethodMessageHandler.class).getPathMatcher();
}
- catch (NoSuchBeanDefinitionException e) {
+ catch (NoSuchBeanDefinitionException ex) {
return new AntPathMatcher();
}
}
diff --git a/config/src/main/java/org/springframework/security/config/authentication/AuthenticationManagerFactoryBean.java b/config/src/main/java/org/springframework/security/config/authentication/AuthenticationManagerFactoryBean.java
index 6baac6525a7..188ead0fb37 100644
--- a/config/src/main/java/org/springframework/security/config/authentication/AuthenticationManagerFactoryBean.java
+++ b/config/src/main/java/org/springframework/security/config/authentication/AuthenticationManagerFactoryBean.java
@@ -51,9 +51,9 @@ public AuthenticationManager getObject() throws Exception {
try {
return (AuthenticationManager) this.bf.getBean(BeanIds.AUTHENTICATION_MANAGER);
}
- catch (NoSuchBeanDefinitionException e) {
- if (!BeanIds.AUTHENTICATION_MANAGER.equals(e.getBeanName())) {
- throw e;
+ catch (NoSuchBeanDefinitionException ex) {
+ if (!BeanIds.AUTHENTICATION_MANAGER.equals(ex.getBeanName())) {
+ throw ex;
}
UserDetailsService uds = getBeanOrNull(UserDetailsService.class);
diff --git a/config/src/main/java/org/springframework/security/config/authentication/UserServiceBeanDefinitionParser.java b/config/src/main/java/org/springframework/security/config/authentication/UserServiceBeanDefinitionParser.java
index f6b4a1ca56c..4a6bca29514 100644
--- a/config/src/main/java/org/springframework/security/config/authentication/UserServiceBeanDefinitionParser.java
+++ b/config/src/main/java/org/springframework/security/config/authentication/UserServiceBeanDefinitionParser.java
@@ -118,7 +118,7 @@ private String generateRandomPassword() {
try {
this.random = SecureRandom.getInstance("SHA1PRNG");
}
- catch (NoSuchAlgorithmException e) {
+ catch (NoSuchAlgorithmException ex) {
// Shouldn't happen...
throw new RuntimeException("Failed find SHA1PRNG algorithm!");
}
diff --git a/config/src/main/java/org/springframework/security/config/crypto/RsaKeyConversionServicePostProcessor.java b/config/src/main/java/org/springframework/security/config/crypto/RsaKeyConversionServicePostProcessor.java
index 6b41064c465..1d7892a626b 100644
--- a/config/src/main/java/org/springframework/security/config/crypto/RsaKeyConversionServicePostProcessor.java
+++ b/config/src/main/java/org/springframework/security/config/crypto/RsaKeyConversionServicePostProcessor.java
@@ -113,8 +113,8 @@ private InputStream toInputStream(Resource resource) {
try {
return resource.getInputStream();
}
- catch (IOException e) {
- throw new UncheckedIOException(e);
+ catch (IOException ex) {
+ throw new UncheckedIOException(ex);
}
}
@@ -123,8 +123,8 @@ private Converter autoclose(Converter inputS
try (InputStream is = inputStream) {
return inputStreamKeyConverter.convert(is);
}
- catch (IOException e) {
- throw new UncheckedIOException(e);
+ catch (IOException ex) {
+ throw new UncheckedIOException(ex);
}
};
}
diff --git a/config/src/main/java/org/springframework/security/config/http/DefaultFilterChainValidator.java b/config/src/main/java/org/springframework/security/config/http/DefaultFilterChainValidator.java
index 2361a5a168c..1b587aca6ed 100644
--- a/config/src/main/java/org/springframework/security/config/http/DefaultFilterChainValidator.java
+++ b/config/src/main/java/org/springframework/security/config/http/DefaultFilterChainValidator.java
@@ -152,7 +152,7 @@ private void checkLoginPageIsntProtected(FilterChainProxy fcp, List filt
try {
filters = fcp.getFilters(loginPage);
}
- catch (Exception e) {
+ catch (Exception ex) {
// May happen legitimately if a filter-chain request matcher requires more
// request data than that provided
// by the dummy request used when creating the filter invocation.
@@ -196,19 +196,19 @@ private void checkLoginPageIsntProtected(FilterChainProxy fcp, List filt
try {
fsi.getAccessDecisionManager().decide(token, loginRequest, attributes);
}
- catch (AccessDeniedException e) {
+ catch (AccessDeniedException ex) {
this.logger
.warn("Anonymous access to the login page doesn't appear to be enabled. This is almost certainly "
+ "an error. Please check your configuration allows unauthenticated access to the configured "
- + "login page. (Simulated access was rejected: " + e + ")");
+ + "login page. (Simulated access was rejected: " + ex + ")");
}
- catch (Exception e) {
+ catch (Exception ex) {
// May happen legitimately if a filter-chain request matcher requires more
// request data than that provided
// by the dummy request used when creating the filter invocation. See SEC-1878
this.logger.info(
"Unable to check access to the login page to determine if anonymous access is allowed. This might be an error, but can happen under normal circumstances.",
- e);
+ ex);
}
}
diff --git a/config/src/main/java/org/springframework/security/config/http/HeadersBeanDefinitionParser.java b/config/src/main/java/org/springframework/security/config/http/HeadersBeanDefinitionParser.java
index 1116d171db7..d1a4d4c5526 100644
--- a/config/src/main/java/org/springframework/security/config/http/HeadersBeanDefinitionParser.java
+++ b/config/src/main/java/org/springframework/security/config/http/HeadersBeanDefinitionParser.java
@@ -478,9 +478,9 @@ private void parseAllowFromFrameOptionsElement(ParserContext parserContext, Bean
try {
builder.addConstructorArgValue(new StaticAllowFromStrategy(new URI(value)));
}
- catch (URISyntaxException e) {
+ catch (URISyntaxException ex) {
parserContext.getReaderContext().error("'value' attribute doesn't represent a valid URI.", frameElement,
- e);
+ ex);
}
return;
}
diff --git a/config/src/main/java/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParser.java b/config/src/main/java/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParser.java
index 5c7358ab731..7d5d9ba6f05 100644
--- a/config/src/main/java/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParser.java
+++ b/config/src/main/java/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParser.java
@@ -363,7 +363,7 @@ public boolean matches(HttpServletRequest request) {
try {
return this.bearerTokenResolver.resolve(request) != null;
}
- catch (OAuth2AuthenticationException e) {
+ catch (OAuth2AuthenticationException ex) {
return false;
}
}
diff --git a/config/src/main/java/org/springframework/security/config/ldap/ContextSourceSettingPostProcessor.java b/config/src/main/java/org/springframework/security/config/ldap/ContextSourceSettingPostProcessor.java
index 33abea69609..08b485ce90d 100644
--- a/config/src/main/java/org/springframework/security/config/ldap/ContextSourceSettingPostProcessor.java
+++ b/config/src/main/java/org/springframework/security/config/ldap/ContextSourceSettingPostProcessor.java
@@ -52,10 +52,10 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory bf) throws Be
contextSourceClass = ClassUtils.forName(REQUIRED_CONTEXT_SOURCE_CLASS_NAME,
ClassUtils.getDefaultClassLoader());
}
- catch (ClassNotFoundException e) {
+ catch (ClassNotFoundException ex) {
throw new ApplicationContextException("Couldn't locate: " + REQUIRED_CONTEXT_SOURCE_CLASS_NAME + ". "
+ " If you are using LDAP with Spring Security, please ensure that you include the spring-ldap "
- + "jar file in your application", e);
+ + "jar file in your application", ex);
}
String[] sources = bf.getBeanNamesForType(contextSourceClass, false, false);
diff --git a/config/src/main/java/org/springframework/security/config/ldap/LdapServerBeanDefinitionParser.java b/config/src/main/java/org/springframework/security/config/ldap/LdapServerBeanDefinitionParser.java
index 3437a1bb5ca..1fa72e12108 100644
--- a/config/src/main/java/org/springframework/security/config/ldap/LdapServerBeanDefinitionParser.java
+++ b/config/src/main/java/org/springframework/security/config/ldap/LdapServerBeanDefinitionParser.java
@@ -221,7 +221,7 @@ private String getDefaultPort() {
try (ServerSocket serverSocket = new ServerSocket(DEFAULT_PORT)) {
return String.valueOf(serverSocket.getLocalPort());
}
- catch (IOException e) {
+ catch (IOException ex) {
return RANDOM_PORT;
}
}
diff --git a/config/src/main/java/org/springframework/security/config/method/GlobalMethodSecurityBeanDefinitionParser.java b/config/src/main/java/org/springframework/security/config/method/GlobalMethodSecurityBeanDefinitionParser.java
index 91439f2d354..e9a1f7c1028 100644
--- a/config/src/main/java/org/springframework/security/config/method/GlobalMethodSecurityBeanDefinitionParser.java
+++ b/config/src/main/java/org/springframework/security/config/method/GlobalMethodSecurityBeanDefinitionParser.java
@@ -489,12 +489,12 @@ public Authentication authenticate(Authentication authentication) throws Authent
try {
this.delegate = this.beanFactory.getBean(this.authMgrBean, AuthenticationManager.class);
}
- catch (NoSuchBeanDefinitionException e) {
- if (BeanIds.AUTHENTICATION_MANAGER.equals(e.getBeanName())) {
+ catch (NoSuchBeanDefinitionException ex) {
+ if (BeanIds.AUTHENTICATION_MANAGER.equals(ex.getBeanName())) {
throw new NoSuchBeanDefinitionException(BeanIds.AUTHENTICATION_MANAGER,
AuthenticationManagerFactoryBean.MISSING_BEAN_ERROR_MESSAGE);
}
- throw e;
+ throw ex;
}
}
}
diff --git a/config/src/main/java/org/springframework/security/config/method/ProtectPointcutPostProcessor.java b/config/src/main/java/org/springframework/security/config/method/ProtectPointcutPostProcessor.java
index 7d133613878..add166d3e52 100644
--- a/config/src/main/java/org/springframework/security/config/method/ProtectPointcutPostProcessor.java
+++ b/config/src/main/java/org/springframework/security/config/method/ProtectPointcutPostProcessor.java
@@ -122,8 +122,8 @@ public Object postProcessBeforeInitialization(Object bean, String beanName) thro
try {
methods = bean.getClass().getMethods();
}
- catch (Exception e) {
- throw new IllegalStateException(e.getMessage());
+ catch (Exception ex) {
+ throw new IllegalStateException(ex.getMessage());
}
// Check to see if any of those methods are compatible with our pointcut
diff --git a/config/src/main/java/org/springframework/security/config/web/server/ServerHttpSecurity.java b/config/src/main/java/org/springframework/security/config/web/server/ServerHttpSecurity.java
index 5d87cbfa9e2..8d55920d156 100644
--- a/config/src/main/java/org/springframework/security/config/web/server/ServerHttpSecurity.java
+++ b/config/src/main/java/org/springframework/security/config/web/server/ServerHttpSecurity.java
@@ -1426,8 +1426,8 @@ private String buildToString() {
return writer.toString();
}
}
- catch (IOException e) {
- throw new RuntimeException(e);
+ catch (IOException ex) {
+ throw new RuntimeException(ex);
}
}
diff --git a/config/src/test/java/org/springframework/security/config/InvalidConfigurationTests.java b/config/src/test/java/org/springframework/security/config/InvalidConfigurationTests.java
index 7870b89cac1..d06229151a7 100644
--- a/config/src/test/java/org/springframework/security/config/InvalidConfigurationTests.java
+++ b/config/src/test/java/org/springframework/security/config/InvalidConfigurationTests.java
@@ -62,8 +62,8 @@ public void missingAuthenticationManagerGivesSensibleErrorMessage() {
setContext("");
fail();
}
- catch (BeanCreationException e) {
- Throwable cause = ultimateCause(e);
+ catch (BeanCreationException ex) {
+ Throwable cause = ultimateCause(ex);
assertThat(cause instanceof NoSuchBeanDefinitionException).isTrue();
NoSuchBeanDefinitionException nsbe = (NoSuchBeanDefinitionException) cause;
assertThat(nsbe.getBeanName()).isEqualTo(BeanIds.AUTHENTICATION_MANAGER);
@@ -71,11 +71,11 @@ public void missingAuthenticationManagerGivesSensibleErrorMessage() {
}
}
- private Throwable ultimateCause(Throwable e) {
- if (e.getCause() == null) {
- return e;
+ private Throwable ultimateCause(Throwable ex) {
+ if (ex.getCause() == null) {
+ return ex;
}
- return ultimateCause(e.getCause());
+ return ultimateCause(ex.getCause());
}
private void setContext(String context) {
diff --git a/config/src/test/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfigurationTests.java b/config/src/test/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfigurationTests.java
index e2dc8e56bfa..22eaa2005a0 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfigurationTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfigurationTests.java
@@ -113,7 +113,7 @@ public void methodSecurityAuthenticationManagerPublishesEvent() {
try {
this.authenticationManager.authenticate(new UsernamePasswordAuthenticationToken("foo", "bar"));
}
- catch (AuthenticationException e) {
+ catch (AuthenticationException ex) {
}
assertThat(this.events.getEvents()).extracting(Object::getClass)
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpX509Tests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpX509Tests.java
index 74cc76cd4d6..f179ec95c54 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpX509Tests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpX509Tests.java
@@ -120,8 +120,8 @@ T loadCert(String location) {
CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
return (T) certFactory.generateCertificate(is);
}
- catch (Exception e) {
- throw new IllegalArgumentException(e);
+ catch (Exception ex) {
+ throw new IllegalArgumentException(ex);
}
}
@@ -244,8 +244,8 @@ private String extractCommonName(X509Certificate certificate) {
try {
return ((X500Name) certificate.getSubjectDN()).getCommonName();
}
- catch (Exception e) {
- throw new IllegalArgumentException(e);
+ catch (Exception ex) {
+ throw new IllegalArgumentException(ex);
}
}
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/ServletApiConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/ServletApiConfigurerTests.java
index 0850eb24ca8..ae3318db300 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/ServletApiConfigurerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/ServletApiConfigurerTests.java
@@ -209,8 +209,8 @@ private T getFieldValue(Object target, String fieldName) {
try {
return (T) FieldUtils.getFieldValue(target, fieldName);
}
- catch (Exception e) {
- throw new RuntimeException(e);
+ catch (Exception ex) {
+ throw new RuntimeException(ex);
}
}
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/X509ConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/X509ConfigurerTests.java
index e497365b44b..0de22b0bb09 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/X509ConfigurerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/X509ConfigurerTests.java
@@ -94,8 +94,8 @@ private T loadCert(String location) {
CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
return (T) certFactory.generateCertificate(is);
}
- catch (Exception e) {
- throw new IllegalArgumentException(e);
+ catch (Exception ex) {
+ throw new IllegalArgumentException(ex);
}
}
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurerTests.java
index 4a6223ef00d..0205de29b3a 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurerTests.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurerTests.java
@@ -256,8 +256,8 @@ private static String samlInflate(byte[] b) {
iout.finish();
return new String(out.toByteArray(), StandardCharsets.UTF_8);
}
- catch (IOException e) {
- throw new Saml2Exception("Unable to inflate string", e);
+ catch (IOException ex) {
+ throw new Saml2Exception("Unable to inflate string", ex);
}
}
diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/saml2/TestSaml2Credentials.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/saml2/TestSaml2Credentials.java
index ddccf536925..fc998695759 100644
--- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/saml2/TestSaml2Credentials.java
+++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/saml2/TestSaml2Credentials.java
@@ -64,8 +64,8 @@ static X509Certificate x509Certificate(String source) {
return (X509Certificate) factory
.generateCertificate(new ByteArrayInputStream(source.getBytes(StandardCharsets.UTF_8)));
}
- catch (Exception e) {
- throw new IllegalArgumentException(e);
+ catch (Exception ex) {
+ throw new IllegalArgumentException(ex);
}
}
diff --git a/config/src/test/java/org/springframework/security/config/doc/XmlParser.java b/config/src/test/java/org/springframework/security/config/doc/XmlParser.java
index bcc90a63b9f..263ee0451f3 100644
--- a/config/src/test/java/org/springframework/security/config/doc/XmlParser.java
+++ b/config/src/test/java/org/springframework/security/config/doc/XmlParser.java
@@ -42,8 +42,8 @@ public XmlNode parse() {
return new XmlNode(dBuilder.parse(this.xml));
}
- catch (IOException | ParserConfigurationException | SAXException e) {
- throw new IllegalStateException(e);
+ catch (IOException | ParserConfigurationException | SAXException ex) {
+ throw new IllegalStateException(ex);
}
}
diff --git a/config/src/test/java/org/springframework/security/config/http/SessionManagementConfigTests.java b/config/src/test/java/org/springframework/security/config/http/SessionManagementConfigTests.java
index 1abb75a8164..b4a7bdc8c77 100644
--- a/config/src/test/java/org/springframework/security/config/http/SessionManagementConfigTests.java
+++ b/config/src/test/java/org/springframework/security/config/http/SessionManagementConfigTests.java
@@ -418,8 +418,8 @@ private T getFieldValue(Object target, String fieldName) {
try {
return (T) FieldUtils.getFieldValue(target, fieldName);
}
- catch (Exception e) {
- throw new RuntimeException(e);
+ catch (Exception ex) {
+ throw new RuntimeException(ex);
}
}
diff --git a/config/src/test/java/org/springframework/security/config/test/SpringTestContext.java b/config/src/test/java/org/springframework/security/config/test/SpringTestContext.java
index d4f477eb252..9da52a47c74 100644
--- a/config/src/test/java/org/springframework/security/config/test/SpringTestContext.java
+++ b/config/src/test/java/org/springframework/security/config/test/SpringTestContext.java
@@ -65,7 +65,7 @@ public void close() {
try {
this.context.close();
}
- catch (Exception e) {
+ catch (Exception ex) {
}
}
diff --git a/config/src/test/java/org/springframework/security/config/web/server/OAuth2ResourceServerSpecTests.java b/config/src/test/java/org/springframework/security/config/web/server/OAuth2ResourceServerSpecTests.java
index eb4940ca2d5..3f01bf9d14f 100644
--- a/config/src/test/java/org/springframework/security/config/web/server/OAuth2ResourceServerSpecTests.java
+++ b/config/src/test/java/org/springframework/security/config/web/server/OAuth2ResourceServerSpecTests.java
@@ -447,8 +447,8 @@ private static RSAPublicKey publicKey() {
KeyFactory factory = KeyFactory.getInstance("RSA");
rsaPublicKey = (RSAPublicKey) factory.generatePublic(spec);
}
- catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
- e.printStackTrace();
+ catch (NoSuchAlgorithmException | InvalidKeySpecException ex) {
+ ex.printStackTrace();
}
return rsaPublicKey;
}
diff --git a/config/src/test/java/org/springframework/security/config/web/server/ServerHttpSecurityTests.java b/config/src/test/java/org/springframework/security/config/web/server/ServerHttpSecurityTests.java
index 44fe067da95..0769425fd76 100644
--- a/config/src/test/java/org/springframework/security/config/web/server/ServerHttpSecurityTests.java
+++ b/config/src/test/java/org/springframework/security/config/web/server/ServerHttpSecurityTests.java
@@ -470,7 +470,7 @@ private boolean isX509Filter(WebFilter filter) {
Object converter = ReflectionTestUtils.getField(filter, "authenticationConverter");
return converter.getClass().isAssignableFrom(ServerX509AuthenticationConverter.class);
}
- catch (IllegalArgumentException e) {
+ catch (IllegalArgumentException ex) {
// field doesn't exist
return false;
}
diff --git a/core/src/main/java/org/springframework/security/access/AccessDeniedException.java b/core/src/main/java/org/springframework/security/access/AccessDeniedException.java
index 4d703b30c7d..3bf6ceac5a0 100644
--- a/core/src/main/java/org/springframework/security/access/AccessDeniedException.java
+++ b/core/src/main/java/org/springframework/security/access/AccessDeniedException.java
@@ -36,10 +36,10 @@ public AccessDeniedException(String msg) {
* Constructs an AccessDeniedException
with the specified message and
* root cause.
* @param msg the detail message
- * @param t root cause
+ * @param cause root cause
*/
- public AccessDeniedException(String msg, Throwable t) {
- super(msg, t);
+ public AccessDeniedException(String msg, Throwable cause) {
+ super(msg, cause);
}
}
diff --git a/core/src/main/java/org/springframework/security/access/AuthorizationServiceException.java b/core/src/main/java/org/springframework/security/access/AuthorizationServiceException.java
index 7fe3affa794..6952be563a6 100644
--- a/core/src/main/java/org/springframework/security/access/AuthorizationServiceException.java
+++ b/core/src/main/java/org/springframework/security/access/AuthorizationServiceException.java
@@ -39,10 +39,10 @@ public AuthorizationServiceException(String msg) {
* Constructs an AuthorizationServiceException
with the specified message
* and root cause.
* @param msg the detail message
- * @param t root cause
+ * @param cause root cause
*/
- public AuthorizationServiceException(String msg, Throwable t) {
- super(msg, t);
+ public AuthorizationServiceException(String msg, Throwable cause) {
+ super(msg, cause);
}
}
diff --git a/core/src/main/java/org/springframework/security/access/expression/ExpressionUtils.java b/core/src/main/java/org/springframework/security/access/expression/ExpressionUtils.java
index 8a3a272eca4..235ca28e9ae 100644
--- a/core/src/main/java/org/springframework/security/access/expression/ExpressionUtils.java
+++ b/core/src/main/java/org/springframework/security/access/expression/ExpressionUtils.java
@@ -25,8 +25,9 @@ public static boolean evaluateAsBoolean(Expression expr, EvaluationContext ctx)
try {
return expr.getValue(ctx, Boolean.class);
}
- catch (EvaluationException e) {
- throw new IllegalArgumentException("Failed to evaluate expression '" + expr.getExpressionString() + "'", e);
+ catch (EvaluationException ex) {
+ throw new IllegalArgumentException("Failed to evaluate expression '" + expr.getExpressionString() + "'",
+ ex);
}
}
diff --git a/core/src/main/java/org/springframework/security/access/expression/method/ExpressionBasedAnnotationAttributeFactory.java b/core/src/main/java/org/springframework/security/access/expression/method/ExpressionBasedAnnotationAttributeFactory.java
index ef49f462599..8cef2cec596 100644
--- a/core/src/main/java/org/springframework/security/access/expression/method/ExpressionBasedAnnotationAttributeFactory.java
+++ b/core/src/main/java/org/springframework/security/access/expression/method/ExpressionBasedAnnotationAttributeFactory.java
@@ -54,8 +54,8 @@ public PreInvocationAttribute createPreInvocationAttribute(String preFilterAttri
: parser.parseExpression(preFilterAttribute);
return new PreInvocationExpressionAttribute(preFilterExpression, filterObject, preAuthorizeExpression);
}
- catch (ParseException e) {
- throw new IllegalArgumentException("Failed to parse expression '" + e.getExpressionString() + "'", e);
+ catch (ParseException ex) {
+ throw new IllegalArgumentException("Failed to parse expression '" + ex.getExpressionString() + "'", ex);
}
}
@@ -73,8 +73,8 @@ public PostInvocationAttribute createPostInvocationAttribute(String postFilterAt
return new PostInvocationExpressionAttribute(postFilterExpression, postAuthorizeExpression);
}
}
- catch (ParseException e) {
- throw new IllegalArgumentException("Failed to parse expression '" + e.getExpressionString() + "'", e);
+ catch (ParseException ex) {
+ throw new IllegalArgumentException("Failed to parse expression '" + ex.getExpressionString() + "'", ex);
}
return null;
diff --git a/core/src/main/java/org/springframework/security/authentication/AccountExpiredException.java b/core/src/main/java/org/springframework/security/authentication/AccountExpiredException.java
index b5a3c170627..e8ef659882e 100644
--- a/core/src/main/java/org/springframework/security/authentication/AccountExpiredException.java
+++ b/core/src/main/java/org/springframework/security/authentication/AccountExpiredException.java
@@ -36,10 +36,10 @@ public AccountExpiredException(String msg) {
* Constructs a AccountExpiredException
with the specified message and
* root cause.
* @param msg the detail message
- * @param t root cause
+ * @param cause root cause
*/
- public AccountExpiredException(String msg, Throwable t) {
- super(msg, t);
+ public AccountExpiredException(String msg, Throwable cause) {
+ super(msg, cause);
}
}
diff --git a/core/src/main/java/org/springframework/security/authentication/AccountStatusException.java b/core/src/main/java/org/springframework/security/authentication/AccountStatusException.java
index 56e6daa30bb..59c68fe5536 100644
--- a/core/src/main/java/org/springframework/security/authentication/AccountStatusException.java
+++ b/core/src/main/java/org/springframework/security/authentication/AccountStatusException.java
@@ -29,8 +29,8 @@ public AccountStatusException(String msg) {
super(msg);
}
- public AccountStatusException(String msg, Throwable t) {
- super(msg, t);
+ public AccountStatusException(String msg, Throwable cause) {
+ super(msg, cause);
}
}
diff --git a/core/src/main/java/org/springframework/security/authentication/AuthenticationCredentialsNotFoundException.java b/core/src/main/java/org/springframework/security/authentication/AuthenticationCredentialsNotFoundException.java
index 7224110fb0d..91b5d616d88 100644
--- a/core/src/main/java/org/springframework/security/authentication/AuthenticationCredentialsNotFoundException.java
+++ b/core/src/main/java/org/springframework/security/authentication/AuthenticationCredentialsNotFoundException.java
@@ -41,10 +41,10 @@ public AuthenticationCredentialsNotFoundException(String msg) {
* Constructs an AuthenticationCredentialsNotFoundException
with the
* specified message and root cause.
* @param msg the detail message
- * @param t root cause
+ * @param cause root cause
*/
- public AuthenticationCredentialsNotFoundException(String msg, Throwable t) {
- super(msg, t);
+ public AuthenticationCredentialsNotFoundException(String msg, Throwable cause) {
+ super(msg, cause);
}
}
diff --git a/core/src/main/java/org/springframework/security/authentication/AuthenticationServiceException.java b/core/src/main/java/org/springframework/security/authentication/AuthenticationServiceException.java
index b87f01d6475..69d7233bdf9 100644
--- a/core/src/main/java/org/springframework/security/authentication/AuthenticationServiceException.java
+++ b/core/src/main/java/org/springframework/security/authentication/AuthenticationServiceException.java
@@ -42,10 +42,10 @@ public AuthenticationServiceException(String msg) {
* Constructs an AuthenticationServiceException
with the specified
* message and root cause.
* @param msg the detail message
- * @param t root cause
+ * @param cause root cause
*/
- public AuthenticationServiceException(String msg, Throwable t) {
- super(msg, t);
+ public AuthenticationServiceException(String msg, Throwable cause) {
+ super(msg, cause);
}
}
diff --git a/core/src/main/java/org/springframework/security/authentication/BadCredentialsException.java b/core/src/main/java/org/springframework/security/authentication/BadCredentialsException.java
index 6f8dc3d4857..e202ef7b5a1 100644
--- a/core/src/main/java/org/springframework/security/authentication/BadCredentialsException.java
+++ b/core/src/main/java/org/springframework/security/authentication/BadCredentialsException.java
@@ -38,10 +38,10 @@ public BadCredentialsException(String msg) {
* Constructs a BadCredentialsException
with the specified message and
* root cause.
* @param msg the detail message
- * @param t root cause
+ * @param cause root cause
*/
- public BadCredentialsException(String msg, Throwable t) {
- super(msg, t);
+ public BadCredentialsException(String msg, Throwable cause) {
+ super(msg, cause);
}
}
diff --git a/core/src/main/java/org/springframework/security/authentication/CredentialsExpiredException.java b/core/src/main/java/org/springframework/security/authentication/CredentialsExpiredException.java
index 03879965187..8e532169aed 100644
--- a/core/src/main/java/org/springframework/security/authentication/CredentialsExpiredException.java
+++ b/core/src/main/java/org/springframework/security/authentication/CredentialsExpiredException.java
@@ -36,10 +36,10 @@ public CredentialsExpiredException(String msg) {
* Constructs a CredentialsExpiredException
with the specified message
* and root cause.
* @param msg the detail message
- * @param t root cause
+ * @param cause root cause
*/
- public CredentialsExpiredException(String msg, Throwable t) {
- super(msg, t);
+ public CredentialsExpiredException(String msg, Throwable cause) {
+ super(msg, cause);
}
}
diff --git a/core/src/main/java/org/springframework/security/authentication/DefaultAuthenticationEventPublisher.java b/core/src/main/java/org/springframework/security/authentication/DefaultAuthenticationEventPublisher.java
index 50b5ffffea3..6b4a344daa0 100644
--- a/core/src/main/java/org/springframework/security/authentication/DefaultAuthenticationEventPublisher.java
+++ b/core/src/main/java/org/springframework/security/authentication/DefaultAuthenticationEventPublisher.java
@@ -155,7 +155,7 @@ public void setAdditionalExceptionMappings(Properties additionalExceptionMapping
Assert.isAssignable(AbstractAuthenticationFailureEvent.class, clazz);
addMapping((String) exceptionClass, (Class extends AbstractAuthenticationFailureEvent>) clazz);
}
- catch (ClassNotFoundException e) {
+ catch (ClassNotFoundException ex) {
throw new RuntimeException("Failed to load authentication event class " + eventClass);
}
}
@@ -194,7 +194,7 @@ public void setDefaultAuthenticationFailureEvent(
this.defaultAuthenticationFailureEventConstructor = defaultAuthenticationFailureEventClass
.getConstructor(Authentication.class, AuthenticationException.class);
}
- catch (NoSuchMethodException e) {
+ catch (NoSuchMethodException ex) {
throw new RuntimeException("Default Authentication Failure event class "
+ defaultAuthenticationFailureEventClass.getName() + " has no suitable constructor");
}
@@ -206,7 +206,7 @@ private void addMapping(String exceptionClass, Class extends AbstractAuthentic
.getConstructor(Authentication.class, AuthenticationException.class);
this.exceptionMappings.put(exceptionClass, constructor);
}
- catch (NoSuchMethodException e) {
+ catch (NoSuchMethodException ex) {
throw new RuntimeException(
"Authentication event class " + eventClass.getName() + " has no suitable constructor");
}
diff --git a/core/src/main/java/org/springframework/security/authentication/DisabledException.java b/core/src/main/java/org/springframework/security/authentication/DisabledException.java
index bb87e72f6f0..31a75ce0cc8 100644
--- a/core/src/main/java/org/springframework/security/authentication/DisabledException.java
+++ b/core/src/main/java/org/springframework/security/authentication/DisabledException.java
@@ -36,10 +36,10 @@ public DisabledException(String msg) {
* Constructs a DisabledException
with the specified message and root
* cause.
* @param msg the detail message
- * @param t root cause
+ * @param cause root cause
*/
- public DisabledException(String msg, Throwable t) {
- super(msg, t);
+ public DisabledException(String msg, Throwable cause) {
+ super(msg, cause);
}
}
diff --git a/core/src/main/java/org/springframework/security/authentication/InsufficientAuthenticationException.java b/core/src/main/java/org/springframework/security/authentication/InsufficientAuthenticationException.java
index 34f84ca3519..0e072b527a1 100644
--- a/core/src/main/java/org/springframework/security/authentication/InsufficientAuthenticationException.java
+++ b/core/src/main/java/org/springframework/security/authentication/InsufficientAuthenticationException.java
@@ -46,10 +46,10 @@ public InsufficientAuthenticationException(String msg) {
* Constructs an InsufficientAuthenticationException
with the specified
* message and root cause.
* @param msg the detail message
- * @param t root cause
+ * @param cause root cause
*/
- public InsufficientAuthenticationException(String msg, Throwable t) {
- super(msg, t);
+ public InsufficientAuthenticationException(String msg, Throwable cause) {
+ super(msg, cause);
}
}
diff --git a/core/src/main/java/org/springframework/security/authentication/LockedException.java b/core/src/main/java/org/springframework/security/authentication/LockedException.java
index f0aa3b5231f..9b2272b08fd 100644
--- a/core/src/main/java/org/springframework/security/authentication/LockedException.java
+++ b/core/src/main/java/org/springframework/security/authentication/LockedException.java
@@ -36,10 +36,10 @@ public LockedException(String msg) {
* Constructs a LockedException
with the specified message and root
* cause.
* @param msg the detail message.
- * @param t root cause
+ * @param cause root cause
*/
- public LockedException(String msg, Throwable t) {
- super(msg, t);
+ public LockedException(String msg, Throwable cause) {
+ super(msg, cause);
}
}
diff --git a/core/src/main/java/org/springframework/security/authentication/ProviderManager.java b/core/src/main/java/org/springframework/security/authentication/ProviderManager.java
index d7054dd37d4..8d6bcce375a 100644
--- a/core/src/main/java/org/springframework/security/authentication/ProviderManager.java
+++ b/core/src/main/java/org/springframework/security/authentication/ProviderManager.java
@@ -188,14 +188,14 @@ public Authentication authenticate(Authentication authentication) throws Authent
break;
}
}
- catch (AccountStatusException | InternalAuthenticationServiceException e) {
- prepareException(e, authentication);
+ catch (AccountStatusException | InternalAuthenticationServiceException ex) {
+ prepareException(ex, authentication);
// SEC-546: Avoid polling additional providers if auth failure is due to
// invalid account status
- throw e;
+ throw ex;
}
- catch (AuthenticationException e) {
- lastException = e;
+ catch (AuthenticationException ex) {
+ lastException = ex;
}
}
@@ -205,15 +205,15 @@ public Authentication authenticate(Authentication authentication) throws Authent
parentResult = this.parent.authenticate(authentication);
result = parentResult;
}
- catch (ProviderNotFoundException e) {
+ catch (ProviderNotFoundException ex) {
// ignore as we will throw below if no other exception occurred prior to
// calling parent and the parent
// may throw ProviderNotFound even though a provider in the child already
// handled the request
}
- catch (AuthenticationException e) {
- parentException = e;
- lastException = e;
+ catch (AuthenticationException ex) {
+ parentException = ex;
+ lastException = ex;
}
}
diff --git a/core/src/main/java/org/springframework/security/authentication/jaas/AbstractJaasAuthenticationProvider.java b/core/src/main/java/org/springframework/security/authentication/jaas/AbstractJaasAuthenticationProvider.java
index 9d6e36907d2..1b801f22b78 100644
--- a/core/src/main/java/org/springframework/security/authentication/jaas/AbstractJaasAuthenticationProvider.java
+++ b/core/src/main/java/org/springframework/security/authentication/jaas/AbstractJaasAuthenticationProvider.java
@@ -256,8 +256,8 @@ else if (debug) {
+ "The LoginContext is unavailable");
}
}
- catch (LoginException e) {
- this.log.warn("Error error logging out of LoginContext", e);
+ catch (LoginException ex) {
+ this.log.warn("Error error logging out of LoginContext", ex);
}
}
}
diff --git a/core/src/main/java/org/springframework/security/authentication/jaas/DefaultLoginExceptionResolver.java b/core/src/main/java/org/springframework/security/authentication/jaas/DefaultLoginExceptionResolver.java
index f106e4f6e77..5b5a261a44f 100644
--- a/core/src/main/java/org/springframework/security/authentication/jaas/DefaultLoginExceptionResolver.java
+++ b/core/src/main/java/org/springframework/security/authentication/jaas/DefaultLoginExceptionResolver.java
@@ -30,8 +30,8 @@
public class DefaultLoginExceptionResolver implements LoginExceptionResolver {
@Override
- public AuthenticationException resolveException(LoginException e) {
- return new AuthenticationServiceException(e.getMessage(), e);
+ public AuthenticationException resolveException(LoginException ex) {
+ return new AuthenticationServiceException(ex.getMessage(), ex);
}
}
diff --git a/core/src/main/java/org/springframework/security/authentication/jaas/JaasAuthenticationProvider.java b/core/src/main/java/org/springframework/security/authentication/jaas/JaasAuthenticationProvider.java
index b458ddefd4f..f5b20e86530 100644
--- a/core/src/main/java/org/springframework/security/authentication/jaas/JaasAuthenticationProvider.java
+++ b/core/src/main/java/org/springframework/security/authentication/jaas/JaasAuthenticationProvider.java
@@ -223,7 +223,7 @@ private String convertLoginConfigToUrl() throws IOException {
return new URL("file", "", loginConfigPath).toString();
}
- catch (IOException e) {
+ catch (IOException ex) {
// SEC-1700: May be inside a jar
return this.loginConfig.getURL().toString();
}
diff --git a/core/src/main/java/org/springframework/security/authentication/jaas/LoginExceptionResolver.java b/core/src/main/java/org/springframework/security/authentication/jaas/LoginExceptionResolver.java
index e086ef35a0f..cdaaed8dfaf 100644
--- a/core/src/main/java/org/springframework/security/authentication/jaas/LoginExceptionResolver.java
+++ b/core/src/main/java/org/springframework/security/authentication/jaas/LoginExceptionResolver.java
@@ -34,10 +34,10 @@ public interface LoginExceptionResolver {
/**
* Translates a Jaas LoginException to an SpringSecurityException.
- * @param e The LoginException thrown by the configured LoginModule.
+ * @param ex The LoginException thrown by the configured LoginModule.
* @return The AuthenticationException that the JaasAuthenticationProvider should
* throw.
*/
- AuthenticationException resolveException(LoginException e);
+ AuthenticationException resolveException(LoginException ex);
}
diff --git a/core/src/main/java/org/springframework/security/converter/RsaKeyConverters.java b/core/src/main/java/org/springframework/security/converter/RsaKeyConverters.java
index 94526af4f38..bf63a858192 100644
--- a/core/src/main/java/org/springframework/security/converter/RsaKeyConverters.java
+++ b/core/src/main/java/org/springframework/security/converter/RsaKeyConverters.java
@@ -82,8 +82,8 @@ public static Converter pkcs8() {
try {
return (RSAPrivateKey) keyFactory.generatePrivate(new PKCS8EncodedKeySpec(pkcs8));
}
- catch (Exception e) {
- throw new IllegalArgumentException(e);
+ catch (Exception ex) {
+ throw new IllegalArgumentException(ex);
}
};
}
@@ -115,8 +115,8 @@ public static Converter x509() {
try {
return (RSAPublicKey) keyFactory.generatePublic(new X509EncodedKeySpec(x509));
}
- catch (Exception e) {
- throw new IllegalArgumentException(e);
+ catch (Exception ex) {
+ throw new IllegalArgumentException(ex);
}
};
}
@@ -130,8 +130,8 @@ private static KeyFactory rsaFactory() {
try {
return KeyFactory.getInstance("RSA");
}
- catch (NoSuchAlgorithmException e) {
- throw new IllegalStateException(e);
+ catch (NoSuchAlgorithmException ex) {
+ throw new IllegalStateException(ex);
}
}
diff --git a/core/src/main/java/org/springframework/security/core/AuthenticationException.java b/core/src/main/java/org/springframework/security/core/AuthenticationException.java
index 4826756b392..e634738b69b 100644
--- a/core/src/main/java/org/springframework/security/core/AuthenticationException.java
+++ b/core/src/main/java/org/springframework/security/core/AuthenticationException.java
@@ -28,10 +28,10 @@ public abstract class AuthenticationException extends RuntimeException {
* Constructs an {@code AuthenticationException} with the specified message and root
* cause.
* @param msg the detail message
- * @param t the root cause
+ * @param cause the root cause
*/
- public AuthenticationException(String msg, Throwable t) {
- super(msg, t);
+ public AuthenticationException(String msg, Throwable cause) {
+ super(msg, cause);
}
/**
diff --git a/core/src/main/java/org/springframework/security/core/SpringSecurityCoreVersion.java b/core/src/main/java/org/springframework/security/core/SpringSecurityCoreVersion.java
index 775298ce1f8..fbe5526e5c8 100644
--- a/core/src/main/java/org/springframework/security/core/SpringSecurityCoreVersion.java
+++ b/core/src/main/java/org/springframework/security/core/SpringSecurityCoreVersion.java
@@ -108,7 +108,7 @@ private static String getSpringVersion() {
properties.load(SpringSecurityCoreVersion.class.getClassLoader()
.getResourceAsStream("META-INF/spring-security.versions"));
}
- catch (IOException | NullPointerException e) {
+ catch (IOException | NullPointerException ex) {
return null;
}
return properties.getProperty("org.springframework:spring-core");
diff --git a/core/src/main/java/org/springframework/security/core/token/Sha512DigestUtils.java b/core/src/main/java/org/springframework/security/core/token/Sha512DigestUtils.java
index a2c16a14fae..a34998f6b9c 100644
--- a/core/src/main/java/org/springframework/security/core/token/Sha512DigestUtils.java
+++ b/core/src/main/java/org/springframework/security/core/token/Sha512DigestUtils.java
@@ -43,8 +43,8 @@ private static MessageDigest getSha512Digest() {
try {
return MessageDigest.getInstance("SHA-512");
}
- catch (NoSuchAlgorithmException e) {
- throw new RuntimeException(e.getMessage());
+ catch (NoSuchAlgorithmException ex) {
+ throw new RuntimeException(ex.getMessage());
}
}
diff --git a/core/src/main/java/org/springframework/security/core/userdetails/UsernameNotFoundException.java b/core/src/main/java/org/springframework/security/core/userdetails/UsernameNotFoundException.java
index 2894852d337..22c3c1d8e5f 100644
--- a/core/src/main/java/org/springframework/security/core/userdetails/UsernameNotFoundException.java
+++ b/core/src/main/java/org/springframework/security/core/userdetails/UsernameNotFoundException.java
@@ -38,10 +38,10 @@ public UsernameNotFoundException(String msg) {
* Constructs a {@code UsernameNotFoundException} with the specified message and root
* cause.
* @param msg the detail message.
- * @param t root cause
+ * @param cause root cause
*/
- public UsernameNotFoundException(String msg, Throwable t) {
- super(msg, t);
+ public UsernameNotFoundException(String msg, Throwable cause) {
+ super(msg, cause);
}
}
diff --git a/core/src/main/java/org/springframework/security/jackson2/SecurityJackson2Modules.java b/core/src/main/java/org/springframework/security/jackson2/SecurityJackson2Modules.java
index a4b4c9cf3c6..03e24ae4a7a 100644
--- a/core/src/main/java/org/springframework/security/jackson2/SecurityJackson2Modules.java
+++ b/core/src/main/java/org/springframework/security/jackson2/SecurityJackson2Modules.java
@@ -107,9 +107,9 @@ private static Module loadAndGetInstance(String className, ClassLoader loader) {
instance = securityModule.newInstance();
}
}
- catch (Exception e) {
+ catch (Exception ex) {
if (logger.isDebugEnabled()) {
- logger.debug("Cannot load module " + className, e);
+ logger.debug("Cannot load module " + className, ex);
}
}
return instance;
diff --git a/core/src/main/java/org/springframework/security/util/MethodInvocationUtils.java b/core/src/main/java/org/springframework/security/util/MethodInvocationUtils.java
index 01fd6746772..ef05c2d84fa 100644
--- a/core/src/main/java/org/springframework/security/util/MethodInvocationUtils.java
+++ b/core/src/main/java/org/springframework/security/util/MethodInvocationUtils.java
@@ -137,7 +137,7 @@ public static MethodInvocation createFromClass(Object targetObject, Class> cla
try {
method = clazz.getMethod(methodName, classArgs);
}
- catch (NoSuchMethodException e) {
+ catch (NoSuchMethodException ex) {
return null;
}
diff --git a/core/src/test/java/org/springframework/security/access/hierarchicalroles/RoleHierarchyImplTests.java b/core/src/test/java/org/springframework/security/access/hierarchicalroles/RoleHierarchyImplTests.java
index 9182ec52141..986d1dc92cc 100644
--- a/core/src/test/java/org/springframework/security/access/hierarchicalroles/RoleHierarchyImplTests.java
+++ b/core/src/test/java/org/springframework/security/access/hierarchicalroles/RoleHierarchyImplTests.java
@@ -117,21 +117,21 @@ public void testCyclesInRoleHierarchy() {
roleHierarchyImpl.setHierarchy("ROLE_A > ROLE_A");
fail("Cycle in role hierarchy was not detected!");
}
- catch (CycleInRoleHierarchyException e) {
+ catch (CycleInRoleHierarchyException ex) {
}
try {
roleHierarchyImpl.setHierarchy("ROLE_A > ROLE_B\nROLE_B > ROLE_A");
fail("Cycle in role hierarchy was not detected!");
}
- catch (CycleInRoleHierarchyException e) {
+ catch (CycleInRoleHierarchyException ex) {
}
try {
roleHierarchyImpl.setHierarchy("ROLE_A > ROLE_B\nROLE_B > ROLE_C\nROLE_C > ROLE_A");
fail("Cycle in role hierarchy was not detected!");
}
- catch (CycleInRoleHierarchyException e) {
+ catch (CycleInRoleHierarchyException ex) {
}
try {
@@ -139,14 +139,14 @@ public void testCyclesInRoleHierarchy() {
"ROLE_A > ROLE_B\nROLE_B > ROLE_C\nROLE_C > ROLE_E\nROLE_E > ROLE_D\nROLE_D > ROLE_B");
fail("Cycle in role hierarchy was not detected!");
}
- catch (CycleInRoleHierarchyException e) {
+ catch (CycleInRoleHierarchyException ex) {
}
try {
roleHierarchyImpl.setHierarchy("ROLE_C > ROLE_B\nROLE_B > ROLE_A\nROLE_A > ROLE_B");
fail("Cycle in role hierarchy was not detected!");
}
- catch (CycleInRoleHierarchyException e) {
+ catch (CycleInRoleHierarchyException ex) {
}
}
@@ -157,7 +157,7 @@ public void testNoCyclesInRoleHierarchy() {
try {
roleHierarchyImpl.setHierarchy("ROLE_A > ROLE_B\nROLE_A > ROLE_C\nROLE_C > ROLE_D\nROLE_B > ROLE_D");
}
- catch (CycleInRoleHierarchyException e) {
+ catch (CycleInRoleHierarchyException ex) {
fail("A cycle in role hierarchy was incorrectly detected!");
}
}
diff --git a/core/src/test/java/org/springframework/security/authentication/ProviderManagerTests.java b/core/src/test/java/org/springframework/security/authentication/ProviderManagerTests.java
index f8616313af7..711ffccfac8 100644
--- a/core/src/test/java/org/springframework/security/authentication/ProviderManagerTests.java
+++ b/core/src/test/java/org/springframework/security/authentication/ProviderManagerTests.java
@@ -271,8 +271,8 @@ public void authenticationExceptionFromParentOverridesPreviousOnes() {
mgr.authenticate(authReq);
fail("Expected exception");
}
- catch (BadCredentialsException e) {
- assertThat(e).isSameAs(expected);
+ catch (BadCredentialsException ex) {
+ assertThat(ex).isSameAs(expected);
}
}
@@ -289,8 +289,8 @@ public void statusExceptionIsPublished() {
mgr.authenticate(authReq);
fail("Expected exception");
}
- catch (LockedException e) {
- assertThat(e).isSameAs(expected);
+ catch (LockedException ex) {
+ assertThat(ex).isSameAs(expected);
}
verify(publisher).publishAuthenticationFailure(expected, authReq);
}
@@ -329,18 +329,18 @@ public void authenticateWhenFailsInParentAndPublishesThenChildDoesNotPublish() {
childMgr.authenticate(authReq);
fail("Expected exception");
}
- catch (BadCredentialsException e) {
- assertThat(e).isSameAs(badCredentialsExParent);
+ catch (BadCredentialsException ex) {
+ assertThat(ex).isSameAs(badCredentialsExParent);
}
verify(publisher).publishAuthenticationFailure(badCredentialsExParent, authReq); // Parent
// publishes
verifyNoMoreInteractions(publisher); // Child should not publish (duplicate event)
}
- private AuthenticationProvider createProviderWhichThrows(final AuthenticationException e) {
+ private AuthenticationProvider createProviderWhichThrows(final AuthenticationException ex) {
AuthenticationProvider provider = mock(AuthenticationProvider.class);
given(provider.supports(any(Class.class))).willReturn(true);
- given(provider.authenticate(any(Authentication.class))).willThrow(e);
+ given(provider.authenticate(any(Authentication.class))).willThrow(ex);
return provider;
}
diff --git a/core/src/test/java/org/springframework/security/authentication/jaas/JaasAuthenticationProviderTests.java b/core/src/test/java/org/springframework/security/authentication/jaas/JaasAuthenticationProviderTests.java
index 4fd27e898b8..cf7f5681e4f 100644
--- a/core/src/test/java/org/springframework/security/authentication/jaas/JaasAuthenticationProviderTests.java
+++ b/core/src/test/java/org/springframework/security/authentication/jaas/JaasAuthenticationProviderTests.java
@@ -77,7 +77,7 @@ public void testBadPassword() {
this.jaasProvider.authenticate(new UsernamePasswordAuthenticationToken("user", "asdf"));
fail("LoginException should have been thrown for the bad password");
}
- catch (AuthenticationException e) {
+ catch (AuthenticationException ex) {
}
assertThat(this.eventCheck.failedEvent).as("Failure event not fired").isNotNull();
@@ -92,7 +92,7 @@ public void testBadUser() {
this.jaasProvider.authenticate(new UsernamePasswordAuthenticationToken("asdf", "password"));
fail("LoginException should have been thrown for the bad user");
}
- catch (AuthenticationException e) {
+ catch (AuthenticationException ex) {
}
assertThat(this.eventCheck.failedEvent).as("Failure event not fired").isNotNull();
@@ -241,9 +241,9 @@ public void testLoginExceptionResolver() {
try {
this.jaasProvider.authenticate(new UsernamePasswordAuthenticationToken("user", "password"));
}
- catch (LockedException e) {
+ catch (LockedException ex) {
}
- catch (Exception e) {
+ catch (Exception ex) {
fail("LockedException should have been thrown and caught");
}
}
diff --git a/core/src/test/java/org/springframework/security/authentication/jaas/SecurityContextLoginModuleTests.java b/core/src/test/java/org/springframework/security/authentication/jaas/SecurityContextLoginModuleTests.java
index dd992af4b08..3f27e71d85c 100644
--- a/core/src/test/java/org/springframework/security/authentication/jaas/SecurityContextLoginModuleTests.java
+++ b/core/src/test/java/org/springframework/security/authentication/jaas/SecurityContextLoginModuleTests.java
@@ -75,7 +75,7 @@ public void testLoginException() {
this.module.login();
fail("LoginException expected, there is no Authentication in the SecurityContext");
}
- catch (LoginException e) {
+ catch (LoginException ex) {
}
}
@@ -107,7 +107,7 @@ public void testNullAuthenticationInSecurityContext() {
this.module.login();
fail("LoginException expected, the authentication is null in the SecurityContext");
}
- catch (Exception e) {
+ catch (Exception ex) {
}
}
diff --git a/core/src/test/java/org/springframework/security/authentication/jaas/TestLoginModule.java b/core/src/test/java/org/springframework/security/authentication/jaas/TestLoginModule.java
index c6aaf08ac78..ab0d94fe90b 100644
--- a/core/src/test/java/org/springframework/security/authentication/jaas/TestLoginModule.java
+++ b/core/src/test/java/org/springframework/security/authentication/jaas/TestLoginModule.java
@@ -63,8 +63,8 @@ public void initialize(Subject subject, CallbackHandler callbackHandler, Map sha
this.password = new String(passwordCallback.getPassword());
this.user = nameCallback.getName();
}
- catch (Exception e) {
- throw new RuntimeException(e);
+ catch (Exception ex) {
+ throw new RuntimeException(ex);
}
}
diff --git a/core/src/test/java/org/springframework/security/core/token/KeyBasedPersistenceTokenServiceTests.java b/core/src/test/java/org/springframework/security/core/token/KeyBasedPersistenceTokenServiceTests.java
index 90fb2095720..dacc3678c5a 100644
--- a/core/src/test/java/org/springframework/security/core/token/KeyBasedPersistenceTokenServiceTests.java
+++ b/core/src/test/java/org/springframework/security/core/token/KeyBasedPersistenceTokenServiceTests.java
@@ -40,8 +40,8 @@ private KeyBasedPersistenceTokenService getService() {
service.setSecureRandom(rnd);
service.afterPropertiesSet();
}
- catch (Exception e) {
- throw new RuntimeException(e);
+ catch (Exception ex) {
+ throw new RuntimeException(ex);
}
return service;
}
diff --git a/crypto/src/main/java/org/springframework/security/crypto/argon2/Argon2PasswordEncoder.java b/crypto/src/main/java/org/springframework/security/crypto/argon2/Argon2PasswordEncoder.java
index 75cf6b3202c..cca18006280 100644
--- a/crypto/src/main/java/org/springframework/security/crypto/argon2/Argon2PasswordEncoder.java
+++ b/crypto/src/main/java/org/springframework/security/crypto/argon2/Argon2PasswordEncoder.java
@@ -107,8 +107,8 @@ public boolean matches(CharSequence rawPassword, String encodedPassword) {
try {
decoded = Argon2EncodingUtils.decode(encodedPassword);
}
- catch (IllegalArgumentException e) {
- this.logger.warn("Malformed password hash", e);
+ catch (IllegalArgumentException ex) {
+ this.logger.warn("Malformed password hash", ex);
return false;
}
diff --git a/crypto/src/main/java/org/springframework/security/crypto/codec/Base64.java b/crypto/src/main/java/org/springframework/security/crypto/codec/Base64.java
index b29021dc07f..366b380a96a 100644
--- a/crypto/src/main/java/org/springframework/security/crypto/codec/Base64.java
+++ b/crypto/src/main/java/org/springframework/security/crypto/codec/Base64.java
@@ -248,7 +248,7 @@ public static boolean isBase64(byte[] bytes) {
try {
decode(bytes);
}
- catch (InvalidBase64CharacterException e) {
+ catch (InvalidBase64CharacterException ex) {
return false;
}
return true;
diff --git a/crypto/src/main/java/org/springframework/security/crypto/codec/Utf8.java b/crypto/src/main/java/org/springframework/security/crypto/codec/Utf8.java
index b82bcdce664..1a926e39854 100644
--- a/crypto/src/main/java/org/springframework/security/crypto/codec/Utf8.java
+++ b/crypto/src/main/java/org/springframework/security/crypto/codec/Utf8.java
@@ -43,8 +43,8 @@ public static byte[] encode(CharSequence string) {
return bytesCopy;
}
- catch (CharacterCodingException e) {
- throw new IllegalArgumentException("Encoding failed", e);
+ catch (CharacterCodingException ex) {
+ throw new IllegalArgumentException("Encoding failed", ex);
}
}
@@ -55,8 +55,8 @@ public static String decode(byte[] bytes) {
try {
return CHARSET.newDecoder().decode(ByteBuffer.wrap(bytes)).toString();
}
- catch (CharacterCodingException e) {
- throw new IllegalArgumentException("Decoding failed", e);
+ catch (CharacterCodingException ex) {
+ throw new IllegalArgumentException("Decoding failed", ex);
}
}
diff --git a/crypto/src/main/java/org/springframework/security/crypto/encrypt/BouncyCastleAesCbcBytesEncryptor.java b/crypto/src/main/java/org/springframework/security/crypto/encrypt/BouncyCastleAesCbcBytesEncryptor.java
index 62b51b2afea..24896cc71e0 100644
--- a/crypto/src/main/java/org/springframework/security/crypto/encrypt/BouncyCastleAesCbcBytesEncryptor.java
+++ b/crypto/src/main/java/org/springframework/security/crypto/encrypt/BouncyCastleAesCbcBytesEncryptor.java
@@ -74,8 +74,8 @@ private byte[] process(BufferedBlockCipher blockCipher, byte[] in) {
try {
bytesWritten += blockCipher.doFinal(buf, bytesWritten);
}
- catch (InvalidCipherTextException e) {
- throw new IllegalStateException("unable to encrypt/decrypt", e);
+ catch (InvalidCipherTextException ex) {
+ throw new IllegalStateException("unable to encrypt/decrypt", ex);
}
if (bytesWritten == buf.length) {
return buf;
diff --git a/crypto/src/main/java/org/springframework/security/crypto/encrypt/BouncyCastleAesGcmBytesEncryptor.java b/crypto/src/main/java/org/springframework/security/crypto/encrypt/BouncyCastleAesGcmBytesEncryptor.java
index 46fcc569a14..cef2d1f9778 100644
--- a/crypto/src/main/java/org/springframework/security/crypto/encrypt/BouncyCastleAesGcmBytesEncryptor.java
+++ b/crypto/src/main/java/org/springframework/security/crypto/encrypt/BouncyCastleAesGcmBytesEncryptor.java
@@ -71,8 +71,8 @@ private byte[] process(AEADBlockCipher blockCipher, byte[] in) {
try {
bytesWritten += blockCipher.doFinal(buf, bytesWritten);
}
- catch (InvalidCipherTextException e) {
- throw new IllegalStateException("unable to encrypt/decrypt", e);
+ catch (InvalidCipherTextException ex) {
+ throw new IllegalStateException("unable to encrypt/decrypt", ex);
}
if (bytesWritten == buf.length) {
return buf;
diff --git a/crypto/src/main/java/org/springframework/security/crypto/encrypt/CipherUtils.java b/crypto/src/main/java/org/springframework/security/crypto/encrypt/CipherUtils.java
index 753a7b535f5..e1a36661150 100644
--- a/crypto/src/main/java/org/springframework/security/crypto/encrypt/CipherUtils.java
+++ b/crypto/src/main/java/org/springframework/security/crypto/encrypt/CipherUtils.java
@@ -56,11 +56,11 @@ public static SecretKey newSecretKey(String algorithm, PBEKeySpec keySpec) {
SecretKeyFactory factory = SecretKeyFactory.getInstance(algorithm);
return factory.generateSecret(keySpec);
}
- catch (NoSuchAlgorithmException e) {
- throw new IllegalArgumentException("Not a valid encryption algorithm", e);
+ catch (NoSuchAlgorithmException ex) {
+ throw new IllegalArgumentException("Not a valid encryption algorithm", ex);
}
- catch (InvalidKeySpecException e) {
- throw new IllegalArgumentException("Not a valid secret key", e);
+ catch (InvalidKeySpecException ex) {
+ throw new IllegalArgumentException("Not a valid secret key", ex);
}
}
@@ -71,11 +71,11 @@ public static Cipher newCipher(String algorithm) {
try {
return Cipher.getInstance(algorithm);
}
- catch (NoSuchAlgorithmException e) {
- throw new IllegalArgumentException("Not a valid encryption algorithm", e);
+ catch (NoSuchAlgorithmException ex) {
+ throw new IllegalArgumentException("Not a valid encryption algorithm", ex);
}
- catch (NoSuchPaddingException e) {
- throw new IllegalStateException("Should not happen", e);
+ catch (NoSuchPaddingException ex) {
+ throw new IllegalStateException("Should not happen", ex);
}
}
@@ -86,8 +86,8 @@ public static T getParameterSpec(Cipher ciphe
try {
return cipher.getParameters().getParameterSpec(parameterSpecClass);
}
- catch (InvalidParameterSpecException e) {
- throw new IllegalArgumentException("Unable to access parameter", e);
+ catch (InvalidParameterSpecException ex) {
+ throw new IllegalArgumentException("Unable to access parameter", ex);
}
}
@@ -117,11 +117,11 @@ public static void initCipher(Cipher cipher, int mode, SecretKey secretKey, Algo
cipher.init(mode, secretKey);
}
}
- catch (InvalidKeyException e) {
- throw new IllegalArgumentException("Unable to initialize due to invalid secret key", e);
+ catch (InvalidKeyException ex) {
+ throw new IllegalArgumentException("Unable to initialize due to invalid secret key", ex);
}
- catch (InvalidAlgorithmParameterException e) {
- throw new IllegalStateException("Unable to initialize due to invalid decryption parameter spec", e);
+ catch (InvalidAlgorithmParameterException ex) {
+ throw new IllegalStateException("Unable to initialize due to invalid decryption parameter spec", ex);
}
}
@@ -133,11 +133,11 @@ public static byte[] doFinal(Cipher cipher, byte[] input) {
try {
return cipher.doFinal(input);
}
- catch (IllegalBlockSizeException e) {
- throw new IllegalStateException("Unable to invoke Cipher due to illegal block size", e);
+ catch (IllegalBlockSizeException ex) {
+ throw new IllegalStateException("Unable to invoke Cipher due to illegal block size", ex);
}
- catch (BadPaddingException e) {
- throw new IllegalStateException("Unable to invoke Cipher due to bad padding", e);
+ catch (BadPaddingException ex) {
+ throw new IllegalStateException("Unable to invoke Cipher due to bad padding", ex);
}
}
diff --git a/crypto/src/main/java/org/springframework/security/crypto/password/Digester.java b/crypto/src/main/java/org/springframework/security/crypto/password/Digester.java
index 7e4755512cd..5add570e418 100644
--- a/crypto/src/main/java/org/springframework/security/crypto/password/Digester.java
+++ b/crypto/src/main/java/org/springframework/security/crypto/password/Digester.java
@@ -64,8 +64,8 @@ private static MessageDigest createDigest(String algorithm) {
try {
return MessageDigest.getInstance(algorithm);
}
- catch (NoSuchAlgorithmException e) {
- throw new IllegalStateException("No such hashing algorithm", e);
+ catch (NoSuchAlgorithmException ex) {
+ throw new IllegalStateException("No such hashing algorithm", ex);
}
}
diff --git a/crypto/src/main/java/org/springframework/security/crypto/password/LdapShaPasswordEncoder.java b/crypto/src/main/java/org/springframework/security/crypto/password/LdapShaPasswordEncoder.java
index d5f42a92ada..8e0a7ec7de8 100644
--- a/crypto/src/main/java/org/springframework/security/crypto/password/LdapShaPasswordEncoder.java
+++ b/crypto/src/main/java/org/springframework/security/crypto/password/LdapShaPasswordEncoder.java
@@ -104,7 +104,7 @@ private String encode(CharSequence rawPassword, byte[] salt) {
sha = MessageDigest.getInstance("SHA");
sha.update(Utf8.encode(rawPassword));
}
- catch (java.security.NoSuchAlgorithmException e) {
+ catch (java.security.NoSuchAlgorithmException ex) {
throw new IllegalStateException("No SHA implementation available!");
}
diff --git a/crypto/src/main/java/org/springframework/security/crypto/password/Pbkdf2PasswordEncoder.java b/crypto/src/main/java/org/springframework/security/crypto/password/Pbkdf2PasswordEncoder.java
index 2b4f5465fec..f777424072d 100644
--- a/crypto/src/main/java/org/springframework/security/crypto/password/Pbkdf2PasswordEncoder.java
+++ b/crypto/src/main/java/org/springframework/security/crypto/password/Pbkdf2PasswordEncoder.java
@@ -112,8 +112,8 @@ public void setAlgorithm(SecretKeyFactoryAlgorithm secretKeyFactoryAlgorithm) {
try {
SecretKeyFactory.getInstance(algorithmName);
}
- catch (NoSuchAlgorithmException e) {
- throw new IllegalArgumentException("Invalid algorithm '" + algorithmName + "'.", e);
+ catch (NoSuchAlgorithmException ex) {
+ throw new IllegalArgumentException("Invalid algorithm '" + algorithmName + "'.", ex);
}
this.algorithm = algorithmName;
}
@@ -163,8 +163,8 @@ private byte[] encode(CharSequence rawPassword, byte[] salt) {
SecretKeyFactory skf = SecretKeyFactory.getInstance(this.algorithm);
return EncodingUtils.concatenate(salt, skf.generateSecret(spec).getEncoded());
}
- catch (GeneralSecurityException e) {
- throw new IllegalStateException("Could not create hash", e);
+ catch (GeneralSecurityException ex) {
+ throw new IllegalStateException("Could not create hash", ex);
}
}
diff --git a/crypto/src/test/java/org/springframework/security/crypto/encrypt/CryptoAssumptions.java b/crypto/src/test/java/org/springframework/security/crypto/encrypt/CryptoAssumptions.java
index 4c238552fd8..fc77e011de8 100644
--- a/crypto/src/test/java/org/springframework/security/crypto/encrypt/CryptoAssumptions.java
+++ b/crypto/src/test/java/org/springframework/security/crypto/encrypt/CryptoAssumptions.java
@@ -41,11 +41,11 @@ private static void assumeAes256(CipherAlgorithm cipherAlgorithm) {
Cipher.getInstance(cipherAlgorithm.toString());
aes256Available = Cipher.getMaxAllowedKeyLength("AES") >= 256;
}
- catch (NoSuchAlgorithmException e) {
- throw new AssumptionViolatedException(cipherAlgorithm + " not available, skipping test", e);
+ catch (NoSuchAlgorithmException ex) {
+ throw new AssumptionViolatedException(cipherAlgorithm + " not available, skipping test", ex);
}
- catch (NoSuchPaddingException e) {
- throw new AssumptionViolatedException(cipherAlgorithm + " padding not available, skipping test", e);
+ catch (NoSuchPaddingException ex) {
+ throw new AssumptionViolatedException(cipherAlgorithm + " padding not available, skipping test", ex);
}
Assume.assumeTrue("AES key length of 256 not allowed, skipping test", aes256Available);
diff --git a/docs/manual/src/docs/asciidoc/_includes/reactive/oauth2/resource-server.adoc b/docs/manual/src/docs/asciidoc/_includes/reactive/oauth2/resource-server.adoc
index d4c0f5f4413..1c774d33f58 100644
--- a/docs/manual/src/docs/asciidoc/_includes/reactive/oauth2/resource-server.adoc
+++ b/docs/manual/src/docs/asciidoc/_includes/reactive/oauth2/resource-server.adoc
@@ -552,9 +552,9 @@ ReactiveJwtDecoder jwtDecoder() {
----
[[webflux-oauth2resourceserver-opaque-minimaldependencies]]
=== Minimal Dependencies for Introspection
-As described in <> most of Resource Server support is collected in `spring-security-oauth2-resource-server`.
-However unless a custom <> is provided, the Resource Server will fallback to ReactiveOpaqueTokenIntrospector.
-Meaning that both `spring-security-oauth2-resource-server` and `oauth2-oidc-sdk` are necessary in order to have a working minimal Resource Server that supports opaque Bearer Tokens.
+As described in <> most of Resource Server support is collected in `spring-security-oauth2-resource-server`.
+However unless a custom <> is provided, the Resource Server will fallback to ReactiveOpaqueTokenIntrospector.
+Meaning that both `spring-security-oauth2-resource-server` and `oauth2-oidc-sdk` are necessary in order to have a working minimal Resource Server that supports opaque Bearer Tokens.
Please refer to `spring-security-oauth2-resource-server` in order to determin the correct version for `oauth2-oidc-sdk`.
[[webflux-oauth2resourceserver-opaque-minimalconfiguration]]
@@ -925,8 +925,8 @@ public class JwtOpaqueTokenIntrospector implements ReactiveOpaqueTokenIntrospect
public Mono convert(JWT jwt) {
try {
return Mono.just(jwt.getJWTClaimsSet());
- } catch (Exception e) {
- return Mono.error(e);
+ } catch (Exception ex) {
+ return Mono.error(ex);
}
}
}
diff --git a/docs/manual/src/docs/asciidoc/_includes/servlet/architecture/exception-translation-filter.adoc b/docs/manual/src/docs/asciidoc/_includes/servlet/architecture/exception-translation-filter.adoc
index 5fa7ecc452a..67cad58ddf1 100644
--- a/docs/manual/src/docs/asciidoc/_includes/servlet/architecture/exception-translation-filter.adoc
+++ b/docs/manual/src/docs/asciidoc/_includes/servlet/architecture/exception-translation-filter.adoc
@@ -36,8 +36,8 @@ The pseudocode for `ExceptionTranslationFilter` looks something like this:
----
try {
filterChain.doFilter(request, response); // <1>
-} catch (AccessDeniedException | AuthenticationException e) {
- if (!authenticated || e instanceof AuthenticationException) {
+} catch (AccessDeniedException | AuthenticationException ex) {
+ if (!authenticated || ex instanceof AuthenticationException) {
startAuthentication(); // <2>
} else {
accessDenied(); // <3>
diff --git a/docs/manual/src/docs/asciidoc/_includes/servlet/integrations/servlet-api.adoc b/docs/manual/src/docs/asciidoc/_includes/servlet/integrations/servlet-api.adoc
index 9e957f39a08..e57d545c15f 100644
--- a/docs/manual/src/docs/asciidoc/_includes/servlet/integrations/servlet-api.adoc
+++ b/docs/manual/src/docs/asciidoc/_includes/servlet/integrations/servlet-api.adoc
@@ -75,7 +75,7 @@ For example, the following would attempt to authenticate with the username "user
----
try {
httpServletRequest.login("user","password");
-} catch(ServletException e) {
+} catch(ServletException ex) {
// fail to authenticate
}
----
@@ -111,8 +111,8 @@ async.start(new Runnable() {
asyncResponse.setStatus(HttpServletResponse.SC_OK);
asyncResponse.getWriter().write(String.valueOf(authentication));
async.complete();
- } catch(Exception e) {
- throw new RuntimeException(e);
+ } catch(Exception ex) {
+ throw new RuntimeException(ex);
}
}
});
@@ -174,8 +174,8 @@ new Thread("AsyncThread") {
// Write to and commit the httpServletResponse
httpServletResponse.getOutputStream().flush();
- } catch (Exception e) {
- e.printStackTrace();
+ } catch (Exception ex) {
+ ex.printStackTrace();
}
}
}.start();
diff --git a/docs/manual/src/docs/asciidoc/_includes/servlet/oauth2/oauth2-resourceserver.adoc b/docs/manual/src/docs/asciidoc/_includes/servlet/oauth2/oauth2-resourceserver.adoc
index f3844ed84ae..42d71a85fc6 100644
--- a/docs/manual/src/docs/asciidoc/_includes/servlet/oauth2/oauth2-resourceserver.adoc
+++ b/docs/manual/src/docs/asciidoc/_includes/servlet/oauth2/oauth2-resourceserver.adoc
@@ -1055,9 +1055,9 @@ To do so, remember that `NimbusJwtDecoder` ships with a constructor that takes N
[[oauth2resourceserver-opaque-minimaldependencies]]
=== Minimal Dependencies for Introspection
-As described in <> most of Resource Server support is collected in `spring-security-oauth2-resource-server`.
-However unless a custom <> is provided, the Resource Server will fallback to NimbusOpaqueTokenIntrospector.
-Meaning that both `spring-security-oauth2-resource-server` and `oauth2-oidc-sdk` are necessary in order to have a working minimal Resource Server that supports opaque Bearer Tokens.
+As described in <> most of Resource Server support is collected in `spring-security-oauth2-resource-server`.
+However unless a custom <> is provided, the Resource Server will fallback to NimbusOpaqueTokenIntrospector.
+Meaning that both `spring-security-oauth2-resource-server` and `oauth2-oidc-sdk` are necessary in order to have a working minimal Resource Server that supports opaque Bearer Tokens.
Please refer to `spring-security-oauth2-resource-server` in order to determin the correct version for `oauth2-oidc-sdk`.
[[oauth2resourceserver-opaque-minimalconfiguration]]
@@ -1626,8 +1626,8 @@ public class JwtOpaqueTokenIntrospector implements OpaqueTokenIntrospector {
try {
Jwt jwt = this.jwtDecoder.decode(token);
return new DefaultOAuth2AuthenticatedPrincipal(jwt.getClaims(), NO_AUTHORITIES);
- } catch (JwtException e) {
- throw new OAuth2IntrospectionException(e);
+ } catch (JwtException ex) {
+ throw new OAuth2IntrospectionException(ex);
}
}
@@ -1899,8 +1899,8 @@ public class TenantJWSKeySelector
private JWSKeySelector fromUri(String uri) {
try {
return JWSAlgorithmFamilyJWSKeySelector.fromJWKSetURL(new URL(uri)); <4>
- } catch (Exception e) {
- throw new IllegalArgumentException(e);
+ } catch (Exception ex) {
+ throw new IllegalArgumentException(ex);
}
}
}
diff --git a/etc/checkstyle/checkstyle-suppressions.xml b/etc/checkstyle/checkstyle-suppressions.xml
index 8a54814b09c..3ec4e39adcb 100644
--- a/etc/checkstyle/checkstyle-suppressions.xml
+++ b/etc/checkstyle/checkstyle-suppressions.xml
@@ -3,7 +3,6 @@
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
-
diff --git a/itest/context/src/main/java/org/springframework/security/integration/python/PythonInterpreterPreInvocationAdvice.java b/itest/context/src/main/java/org/springframework/security/integration/python/PythonInterpreterPreInvocationAdvice.java
index 8ae2b7fbd91..69bcb94e8d0 100644
--- a/itest/context/src/main/java/org/springframework/security/integration/python/PythonInterpreterPreInvocationAdvice.java
+++ b/itest/context/src/main/java/org/springframework/security/integration/python/PythonInterpreterPreInvocationAdvice.java
@@ -52,8 +52,8 @@ public boolean before(Authentication authentication, MethodInvocation mi, PreInv
try {
python.execfile(scriptResource.getInputStream());
}
- catch (IOException e) {
- throw new IllegalArgumentException("Couldn't run python script, " + script, e);
+ catch (IOException ex) {
+ throw new IllegalArgumentException("Couldn't run python script, " + script, ex);
}
PyObject allowed = python.get("allow");
diff --git a/ldap/src/integration-test/java/org/springframework/security/ldap/DefaultSpringSecurityContextSourceTests.java b/ldap/src/integration-test/java/org/springframework/security/ldap/DefaultSpringSecurityContextSourceTests.java
index 7465a786378..31844b45878 100644
--- a/ldap/src/integration-test/java/org/springframework/security/ldap/DefaultSpringSecurityContextSourceTests.java
+++ b/ldap/src/integration-test/java/org/springframework/security/ldap/DefaultSpringSecurityContextSourceTests.java
@@ -85,7 +85,7 @@ public void cantBindWithWrongPasswordImmediatelyAfterSuccessfulBind() throws Exc
try {
ctx = this.contextSource.getContext("uid=Bob,ou=people,dc=springframework,dc=org", "bobspassword");
}
- catch (Exception e) {
+ catch (Exception ex) {
}
assertThat(ctx).isNotNull();
// com.sun.jndi.ldap.LdapPoolManager.showStats(System.out);
diff --git a/ldap/src/integration-test/java/org/springframework/security/ldap/server/ApacheDSContainerTests.java b/ldap/src/integration-test/java/org/springframework/security/ldap/server/ApacheDSContainerTests.java
index eebf38e583a..b297fe66cde 100644
--- a/ldap/src/integration-test/java/org/springframework/security/ldap/server/ApacheDSContainerTests.java
+++ b/ldap/src/integration-test/java/org/springframework/security/ldap/server/ApacheDSContainerTests.java
@@ -69,12 +69,12 @@ public void failsToStartThrowsException() throws Exception {
try {
server1.destroy();
}
- catch (Throwable t) {
+ catch (Throwable ex) {
}
try {
server2.destroy();
}
- catch (Throwable t) {
+ catch (Throwable ex) {
}
}
}
@@ -95,12 +95,12 @@ public void multipleInstancesSimultanciously() throws Exception {
try {
server1.destroy();
}
- catch (Throwable t) {
+ catch (Throwable ex) {
}
try {
server2.destroy();
}
- catch (Throwable t) {
+ catch (Throwable ex) {
}
}
}
@@ -116,8 +116,8 @@ public void startWithLdapOverSslWithoutCertificate() throws Exception {
server.afterPropertiesSet();
fail("Expected an IllegalArgumentException to be thrown.");
}
- catch (IllegalArgumentException e) {
- assertThat(e).hasMessage("When LdapOverSsl is enabled, the keyStoreFile property must be set.");
+ catch (IllegalArgumentException ex) {
+ assertThat(ex).hasMessage("When LdapOverSsl is enabled, the keyStoreFile property must be set.");
}
}
@@ -143,9 +143,9 @@ public void startWithLdapOverSslWithWrongPassword() throws Exception {
server.afterPropertiesSet();
fail("Expected a RuntimeException to be thrown.");
}
- catch (RuntimeException e) {
- assertThat(e).hasMessage("Server startup failed");
- assertThat(e).hasRootCauseInstanceOf(UnrecoverableKeyException.class);
+ catch (RuntimeException ex) {
+ assertThat(ex).hasMessage("Server startup failed");
+ assertThat(ex).hasRootCauseInstanceOf(UnrecoverableKeyException.class);
}
}
@@ -187,7 +187,7 @@ public void startWithLdapOverSsl() throws Exception {
try {
server.destroy();
}
- catch (Throwable t) {
+ catch (Throwable ex) {
}
}
}
diff --git a/ldap/src/integration-test/java/org/springframework/security/ldap/server/UnboundIdContainerLdifTests.java b/ldap/src/integration-test/java/org/springframework/security/ldap/server/UnboundIdContainerLdifTests.java
index ef8c2b440fd..f9f9ed4441f 100644
--- a/ldap/src/integration-test/java/org/springframework/security/ldap/server/UnboundIdContainerLdifTests.java
+++ b/ldap/src/integration-test/java/org/springframework/security/ldap/server/UnboundIdContainerLdifTests.java
@@ -75,9 +75,9 @@ public void unboundIdContainerWhenMalformedLdifThenException() {
this.appCtx = new AnnotationConfigApplicationContext(MalformedLdifConfig.class);
failBecauseExceptionWasNotThrown(IllegalStateException.class);
}
- catch (Exception e) {
- assertThat(e.getCause()).isInstanceOf(IllegalStateException.class);
- assertThat(e.getMessage()).contains("Unable to load LDIF classpath:test-server-malformed.txt");
+ catch (Exception ex) {
+ assertThat(ex.getCause()).isInstanceOf(IllegalStateException.class);
+ assertThat(ex.getMessage()).contains("Unable to load LDIF classpath:test-server-malformed.txt");
}
}
@@ -87,9 +87,9 @@ public void unboundIdContainerWhenMissingLdifThenException() {
this.appCtx = new AnnotationConfigApplicationContext(MissingLdifConfig.class);
failBecauseExceptionWasNotThrown(IllegalStateException.class);
}
- catch (Exception e) {
- assertThat(e.getCause()).isInstanceOf(IllegalStateException.class);
- assertThat(e.getMessage()).contains("Unable to load LDIF classpath:does-not-exist.ldif");
+ catch (Exception ex) {
+ assertThat(ex.getCause()).isInstanceOf(IllegalStateException.class);
+ assertThat(ex.getMessage()).contains("Unable to load LDIF classpath:does-not-exist.ldif");
}
}
diff --git a/ldap/src/main/java/org/springframework/security/ldap/LdapUtils.java b/ldap/src/main/java/org/springframework/security/ldap/LdapUtils.java
index 0f249740755..6bcb430b034 100644
--- a/ldap/src/main/java/org/springframework/security/ldap/LdapUtils.java
+++ b/ldap/src/main/java/org/springframework/security/ldap/LdapUtils.java
@@ -53,8 +53,8 @@ public static void closeContext(Context ctx) {
ctx.close();
}
}
- catch (NamingException e) {
- logger.error("Failed to close context.", e);
+ catch (NamingException ex) {
+ logger.error("Failed to close context.", ex);
}
}
@@ -64,8 +64,8 @@ public static void closeEnumeration(NamingEnumeration ne) {
ne.close();
}
}
- catch (NamingException e) {
- logger.error("Failed to close enumeration.", e);
+ catch (NamingException ex) {
+ logger.error("Failed to close enumeration.", ex);
}
}
@@ -177,9 +177,9 @@ private static URI parseLdapUrl(String url) {
try {
return new URI(url);
}
- catch (URISyntaxException e) {
+ catch (URISyntaxException ex) {
IllegalArgumentException iae = new IllegalArgumentException("Unable to parse url: " + url);
- iae.initCause(e);
+ iae.initCause(ex);
throw iae;
}
}
diff --git a/ldap/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java b/ldap/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java
index 5a7465437ac..6dcb0ba823f 100644
--- a/ldap/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java
+++ b/ldap/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java
@@ -197,8 +197,8 @@ public Set