Skip to content

Commit 114bf09

Browse files
authored
Merge pull request #1471 from kezhenxu94/cleanup/collapse-identical-catch
collapse identical catch
2 parents bf14f33 + 2815350 commit 114bf09

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

src/main/java/org/apache/ibatis/io/VFS.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@ static VFS createVFS() {
6464
" is not valid in this environment.");
6565
}
6666
}
67-
} catch (InstantiationException e) {
68-
log.error("Failed to instantiate " + impl, e);
69-
return null;
70-
} catch (IllegalAccessException e) {
67+
} catch (InstantiationException | IllegalAccessException e) {
7168
log.error("Failed to instantiate " + impl, e);
7269
return null;
7370
}

src/main/java/org/apache/ibatis/logging/slf4j/Slf4jImpl.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ public Slf4jImpl(String clazz) {
3838
logger.getClass().getMethod("log", Marker.class, String.class, int.class, String.class, Object[].class, Throwable.class);
3939
log = new Slf4jLocationAwareLoggerImpl((LocationAwareLogger) logger);
4040
return;
41-
} catch (SecurityException e) {
42-
// fail-back to Slf4jLoggerImpl
43-
} catch (NoSuchMethodException e) {
41+
} catch (SecurityException | NoSuchMethodException e) {
4442
// fail-back to Slf4jLoggerImpl
4543
}
4644
}

src/main/java/org/apache/ibatis/scripting/defaults/DefaultParameterHandler.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ public void setParameters(PreparedStatement ps) {
8585
}
8686
try {
8787
typeHandler.setParameter(ps, i + 1, value, jdbcType);
88-
} catch (TypeException e) {
89-
throw new TypeException("Could not set parameters for mapping: " + parameterMapping + ". Cause: " + e, e);
90-
} catch (SQLException e) {
88+
} catch (TypeException | SQLException e) {
9189
throw new TypeException("Could not set parameters for mapping: " + parameterMapping + ". Cause: " + e, e);
9290
}
9391
}

0 commit comments

Comments
 (0)