diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java index e7f51f7846..e2cfd614e9 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java @@ -239,7 +239,7 @@ public class CrshAutoConfiguration { try { token = this.authenticationManager.authenticate(token); } - catch (AuthenticationException ae) { + catch (AuthenticationException ex) { return false; } @@ -250,7 +250,7 @@ public class CrshAutoConfiguration { this.accessDecisionManager.decide(token, this, SecurityConfig.createList(this.roles)); } - catch (AccessDeniedException e) { + catch (AccessDeniedException ex) { return false; } } @@ -440,7 +440,7 @@ public class CrshAutoConfiguration { try { return this.resource.lastModified(); } - catch (IOException e) { + catch (IOException ex) { } return -1; } diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHealthIndicator.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHealthIndicator.java index fcca0bd82d..fb3346f621 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHealthIndicator.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHealthIndicator.java @@ -50,18 +50,18 @@ public class SimpleHealthIndicator implements HealthIndicator= 0); } - catch (Throwable e) { + catch (Throwable ex) { return false; } } diff --git a/spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesPropertyValues.java b/spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesPropertyValues.java index 3e92db4808..831326accb 100644 --- a/spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesPropertyValues.java +++ b/spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesPropertyValues.java @@ -59,7 +59,7 @@ public class PropertySourcesPropertyValues implements PropertyValues { try { value = resolver.getProperty(propertyName); } - catch (RuntimeException e) { + catch (RuntimeException ex) { // Probably could not resolve placeholders, ignore it here } this.propertyValues.put(propertyName, new PropertyValue( diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedWebApplicationContext.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedWebApplicationContext.java index d9139f237d..374081b1ce 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedWebApplicationContext.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedWebApplicationContext.java @@ -121,9 +121,9 @@ public class EmbeddedWebApplicationContext extends GenericWebApplicationContext try { super.refresh(); } - catch (RuntimeException e) { + catch (RuntimeException ex) { stopAndReleaseEmbeddedServletContainer(); - throw e; + throw ex; } } @@ -340,11 +340,11 @@ public class EmbeddedWebApplicationContext extends GenericWebApplicationContext WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ex); throw ex; } - catch (Error err) { - logger.error("Context initialization failed", err); + catch (Error ex) { + logger.error("Context initialization failed", ex); servletContext.setAttribute( - WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, err); - throw err; + WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ex); + throw ex; } } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainer.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainer.java index 33f0744774..e8d9f750ee 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainer.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainer.java @@ -74,8 +74,8 @@ public class TomcatEmbeddedServletContainer implements EmbeddedServletContainer Connector connector = this.tomcat.getConnector(); connector.getProtocolHandler().stop(); } - catch (Exception e) { - this.logger.error("Cannot pause connector: ", e); + catch (Exception ex) { + this.logger.error("Cannot pause connector: ", ex); } // Unlike Jetty, all Tomcat threads are daemon threads. We create a // blocking non-daemon to stop immediate shutdown @@ -105,8 +105,8 @@ public class TomcatEmbeddedServletContainer implements EmbeddedServletContainer try { connector.getProtocolHandler().start(); } - catch (Exception e) { - this.logger.error("Cannot start connector: ", e); + catch (Exception ex) { + this.logger.error("Cannot start connector: ", ex); } } } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java index 6d9b15f411..a38e04a8d3 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java @@ -454,9 +454,9 @@ public class TomcatEmbeddedServletContainerFactory extends } } } - catch (ClassNotFoundException e) { + catch (ClassNotFoundException ex) { } - catch (LinkageError e) { + catch (LinkageError ex) { } return nativePage; } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedWebappClassLoader.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedWebappClassLoader.java index 2fb50eac60..13c8e54b30 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedWebappClassLoader.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedWebappClassLoader.java @@ -85,7 +85,7 @@ public class TomcatEmbeddedWebappClassLoader extends WebappClassLoader { try { return Class.forName(name, false, this.parent); } - catch (ClassNotFoundException e) { + catch (ClassNotFoundException ex) { return null; } } @@ -94,7 +94,7 @@ public class TomcatEmbeddedWebappClassLoader extends WebappClassLoader { try { return findClass(name); } - catch (ClassNotFoundException e) { + catch (ClassNotFoundException ex) { return null; } } @@ -105,9 +105,9 @@ public class TomcatEmbeddedWebappClassLoader extends WebappClassLoader { this.securityManager.checkPackageAccess(name.substring(0, name.lastIndexOf('.'))); } - catch (SecurityException se) { + catch (SecurityException ex) { throw new ClassNotFoundException("Security Violation, attempt to use " - + "Restricted Class: " + name, se); + + "Restricted Class: " + name, ex); } } } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/initializer/VcapApplicationContextInitializer.java b/spring-boot/src/main/java/org/springframework/boot/context/initializer/VcapApplicationContextInitializer.java index be2162988b..91831962f3 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/initializer/VcapApplicationContextInitializer.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/initializer/VcapApplicationContextInitializer.java @@ -160,8 +160,8 @@ public class VcapApplicationContextInitializer implements properties.putAll(map); } } - catch (Exception e) { - logger.error("Could not parse VCAP_APPLICATION", e); + catch (Exception ex) { + logger.error("Could not parse VCAP_APPLICATION", ex); } return properties; } @@ -187,8 +187,8 @@ public class VcapApplicationContextInitializer implements } } } - catch (Exception e) { - logger.error("Could not parse VCAP_APPLICATION", e); + catch (Exception ex) { + logger.error("Could not parse VCAP_APPLICATION", ex); } return properties; } diff --git a/spring-boot/src/main/java/org/springframework/boot/logging/java/SimpleFormatter.java b/spring-boot/src/main/java/org/springframework/boot/logging/java/SimpleFormatter.java index 55f8d16ad9..c62bcdc8e2 100644 --- a/spring-boot/src/main/java/org/springframework/boot/logging/java/SimpleFormatter.java +++ b/spring-boot/src/main/java/org/springframework/boot/logging/java/SimpleFormatter.java @@ -71,7 +71,7 @@ public class SimpleFormatter extends Formatter { try { value = System.getenv(key); } - catch (Exception e) { + catch (Exception ex) { // ignore } if (value == null) { diff --git a/spring-boot/src/test/java/org/springframework/boot/OutputCapture.java b/spring-boot/src/test/java/org/springframework/boot/OutputCapture.java index b4dd043af0..3da40f3471 100644 --- a/spring-boot/src/test/java/org/springframework/boot/OutputCapture.java +++ b/spring-boot/src/test/java/org/springframework/boot/OutputCapture.java @@ -77,7 +77,7 @@ public class OutputCapture implements TestRule { this.captureOut.flush(); this.captureErr.flush(); } - catch (IOException e) { + catch (IOException ex) { // ignore } } @@ -144,7 +144,7 @@ public class OutputCapture implements TestRule { Class.forName("org.springframework.boot.ansi.AnsiOutput"); return new AnsiPresentOutputControl(); } - catch (ClassNotFoundException e) { + catch (ClassNotFoundException ex) { return new AnsiOutputControl(); } }