OPENJPA-1171:

Replace StringBuffer with StringBuilder in SQLBuffer to reduce synchronization

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@796340 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Dick 2009-07-21 15:15:17 +00:00
parent 0cf0922386
commit 37c2620b1e
1 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ public final class SQLBuffer
private static final String PARAMETER_TOKEN = "?"; private static final String PARAMETER_TOKEN = "?";
private final DBDictionary _dict; private final DBDictionary _dict;
private final StringBuffer _sql = new StringBuffer(); private final StringBuilder _sql = new StringBuilder();
private List _subsels = null; private List _subsels = null;
private List _params = null; private List _params = null;
private List _cols = null; private List _cols = null;
@ -446,7 +446,7 @@ public final class SQLBuffer
if (!replaceParams || _params == null || _params.isEmpty()) if (!replaceParams || _params == null || _params.isEmpty())
return sql; return sql;
StringBuffer buf = new StringBuffer(); StringBuilder buf = new StringBuilder();
Iterator pi = _params.iterator(); Iterator pi = _params.iterator();
for (int i = 0; i < sql.length(); i++) { for (int i = 0; i < sql.length(); i++) {
if (sql.charAt(i) != '?') { if (sql.charAt(i) != '?') {