Skip to content

Commit 5b5ca2d

Browse files
authored
Merge pull request #1860 from hazendaz/checkstyle
[cleanup] Reduce duplicated code by combining prepareStatement & prep…
2 parents c7f926a + cd4a0c2 commit 5b5ca2d

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/main/java/org/apache/ibatis/logging/jdbc/ConnectionLogger.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,7 @@ public Object invoke(Object proxy, Method method, Object[] params)
4848
if (Object.class.equals(method.getDeclaringClass())) {
4949
return method.invoke(this, params);
5050
}
51-
if ("prepareStatement".equals(method.getName())) {
52-
if (isDebugEnabled()) {
53-
debug(" Preparing: " + removeBreakingWhitespace((String) params[0]), true);
54-
}
55-
PreparedStatement stmt = (PreparedStatement) method.invoke(connection, params);
56-
stmt = PreparedStatementLogger.newInstance(stmt, statementLog, queryStack);
57-
return stmt;
58-
} else if ("prepareCall".equals(method.getName())) {
51+
if ("prepareStatement".equals(method.getName()) || "prepareCall".equals(method.getName())) {
5952
if (isDebugEnabled()) {
6053
debug(" Preparing: " + removeBreakingWhitespace((String) params[0]), true);
6154
}

0 commit comments

Comments
 (0)