Skip to content

Commit 2d70a7a

Browse files
committed
Polish caught exception names
Prefer `ex` over `e`.
1 parent 41efea5 commit 2d70a7a

File tree

10 files changed

+13
-13
lines changed

10 files changed

+13
-13
lines changed

Diff for: spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JmxEndpointIntegrationTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private boolean isRegistered(MBeanServer mBeanServer, ObjectName objectName) {
105105
getMBeanInfo(mBeanServer, objectName);
106106
return true;
107107
}
108-
catch (InstanceNotFoundException e) {
108+
catch (InstanceNotFoundException ex) {
109109
return false;
110110
}
111111
}

Diff for: spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusScrapeEndpoint.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ public String scrape() {
5050
TextFormat.write004(writer, this.collectorRegistry.metricFamilySamples());
5151
return writer.toString();
5252
}
53-
catch (IOException e) {
53+
catch (IOException ex) {
5454
// This actually never happens since StringWriter::write() doesn't throw any
5555
// IOException
56-
throw new RuntimeException("Writing metrics failed", e);
56+
throw new RuntimeException("Writing metrics failed", ex);
5757
}
5858
}
5959

Diff for: spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilterTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ public void asyncCompletableFutureRequest() throws Exception {
250250
result.set(this.mvc.perform(get("/api/c1/completableFuture/{id}", 1))
251251
.andExpect(request().asyncStarted()).andReturn());
252252
}
253-
catch (Exception e) {
254-
fail("Failed to execute async request", e);
253+
catch (Exception ex) {
254+
fail("Failed to execute async request", ex);
255255
}
256256
});
257257
backgroundRequest.start();

Diff for: spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private Resource[] getResources(String location, String pattern) {
146146
return this.applicationContext
147147
.getResources(ensureTrailingSlash(location) + pattern);
148148
}
149-
catch (IOException e) {
149+
catch (IOException ex) {
150150
return new Resource[0];
151151
}
152152
}

Diff for: spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/JooqPropertiesTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private DataSource mockDataSource(String jdbcUrl) {
101101
given(connection.getMetaData()).willReturn(metadata);
102102
given(ds.getConnection()).willReturn(connection);
103103
}
104-
catch (SQLException e) {
104+
catch (SQLException ex) {
105105
// Do nothing
106106
}
107107
return ds;

Diff for: spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/CustomHibernateJpaAutoConfigurationTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public DataSource dataSource() {
136136
given(dataSource.getConnection().getMetaData())
137137
.willReturn(mock(DatabaseMetaData.class));
138138
}
139-
catch (SQLException e) {
139+
catch (SQLException ex) {
140140
// Do nothing
141141
}
142142
return dataSource;

Diff for: spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/JpaPropertiesTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ private DataSource mockDataSource(String jdbcUrl) {
307307
given(connection.getMetaData()).willReturn(metadata);
308308
given(ds.getConnection()).willReturn(connection);
309309
}
310-
catch (SQLException e) {
310+
catch (SQLException ex) {
311311
// Do nothing
312312
}
313313
return ds;

Diff for: spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/runner/AbstractApplicationContextRunnerTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public void runWithClassLoaderShouldSetClassLoader() {
158158
context.getClassLoader());
159159
fail("Should have thrown a ClassNotFoundException");
160160
}
161-
catch (ClassNotFoundException e) {
161+
catch (ClassNotFoundException ex) {
162162
// expected
163163
}
164164
});

Diff for: spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/Container.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public Statement apply(Statement base, Description description) {
6464
try {
6565
DockerClientFactory.instance().client();
6666
}
67-
catch (Throwable t) {
67+
catch (Throwable ex) {
6868
return new SkipStatement();
6969
}
7070
this.container = this.containerFactory.get();

Diff for: spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/Neo4jContainer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ public void waitUntilReady() {
6262
Unreliables.retryUntilTrue((int) this.startupTimeout.getSeconds(),
6363
TimeUnit.SECONDS, checkConnection(sessionFactory));
6464
}
65-
catch (TimeoutException e) {
66-
throw new IllegalStateException();
65+
catch (TimeoutException ex) {
66+
throw new IllegalStateException(ex);
6767
}
6868
}
6969

0 commit comments

Comments
 (0)