Polish caught exception names

Prefer `ex` over `e`.
This commit is contained in:
Phillip Webb 2018-05-03 12:50:16 -07:00
parent 41efea51a7
commit 2d70a7ae5e
10 changed files with 13 additions and 13 deletions

View File

@ -105,7 +105,7 @@ public class JmxEndpointIntegrationTests {
getMBeanInfo(mBeanServer, objectName);
return true;
}
catch (InstanceNotFoundException e) {
catch (InstanceNotFoundException ex) {
return false;
}
}

View File

@ -50,10 +50,10 @@ public class PrometheusScrapeEndpoint {
TextFormat.write004(writer, this.collectorRegistry.metricFamilySamples());
return writer.toString();
}
catch (IOException e) {
catch (IOException ex) {
// This actually never happens since StringWriter::write() doesn't throw any
// IOException
throw new RuntimeException("Writing metrics failed", e);
throw new RuntimeException("Writing metrics failed", ex);
}
}

View File

@ -250,8 +250,8 @@ public class WebMvcMetricsFilterTests {
result.set(this.mvc.perform(get("/api/c1/completableFuture/{id}", 1))
.andExpect(request().asyncStarted()).andReturn());
}
catch (Exception e) {
fail("Failed to execute async request", e);
catch (Exception ex) {
fail("Failed to execute async request", ex);
}
});
backgroundRequest.start();

View File

@ -146,7 +146,7 @@ public class WebServicesAutoConfiguration {
return this.applicationContext
.getResources(ensureTrailingSlash(location) + pattern);
}
catch (IOException e) {
catch (IOException ex) {
return new Resource[0];
}
}

View File

@ -101,7 +101,7 @@ public class JooqPropertiesTests {
given(connection.getMetaData()).willReturn(metadata);
given(ds.getConnection()).willReturn(connection);
}
catch (SQLException e) {
catch (SQLException ex) {
// Do nothing
}
return ds;

View File

@ -136,7 +136,7 @@ public class CustomHibernateJpaAutoConfigurationTests {
given(dataSource.getConnection().getMetaData())
.willReturn(mock(DatabaseMetaData.class));
}
catch (SQLException e) {
catch (SQLException ex) {
// Do nothing
}
return dataSource;

View File

@ -307,7 +307,7 @@ public class JpaPropertiesTests {
given(connection.getMetaData()).willReturn(metadata);
given(ds.getConnection()).willReturn(connection);
}
catch (SQLException e) {
catch (SQLException ex) {
// Do nothing
}
return ds;

View File

@ -158,7 +158,7 @@ public abstract class AbstractApplicationContextRunnerTests<T extends AbstractAp
context.getClassLoader());
fail("Should have thrown a ClassNotFoundException");
}
catch (ClassNotFoundException e) {
catch (ClassNotFoundException ex) {
// expected
}
});

View File

@ -64,7 +64,7 @@ class Container implements TestRule {
try {
DockerClientFactory.instance().client();
}
catch (Throwable t) {
catch (Throwable ex) {
return new SkipStatement();
}
this.container = this.containerFactory.get();

View File

@ -62,8 +62,8 @@ public class Neo4jContainer extends Container {
Unreliables.retryUntilTrue((int) this.startupTimeout.getSeconds(),
TimeUnit.SECONDS, checkConnection(sessionFactory));
}
catch (TimeoutException e) {
throw new IllegalStateException();
catch (TimeoutException ex) {
throw new IllegalStateException(ex);
}
}