refactored code, use public field instead of public getter.

This commit is contained in:
wenshao
2016-09-13 10:39:12 +08:00
parent c73573ac8c
commit 49d7884c96
7 changed files with 27 additions and 37 deletions
@@ -67,10 +67,10 @@ public class DruidPooledPreparedStatement extends DruidPooledStatement implement
private boolean pooled = false;
public DruidPooledPreparedStatement(DruidPooledConnection conn, PreparedStatementHolder holder) throws SQLException{
super(conn, holder.getStatement());
this.stmt = holder.getStatement();
super(conn, holder.statement);
this.stmt = holder.statement;
this.holder = holder;
this.sql = holder.getKey().sql;
this.sql = holder.key.sql;
pooled = conn.getConnectionHolder().isPoolPreparedStatements();
// Remember the defaults
@@ -152,7 +152,7 @@ public class DruidPooledPreparedStatement extends DruidPooledStatement implement
}
public PreparedStatementKey getKey() {
return holder.getKey();
return holder.key;
}
public PreparedStatement getRawPreparedStatement() {
@@ -907,8 +907,8 @@ public class DruidPooledPreparedStatement extends DruidPooledStatement implement
public static class PreparedStatementKey {
private final String sql;
private final String catalog;
protected final String sql;
protected final String catalog;
protected final MethodType methodType;