openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r796340 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java
Date Tue, 21 Jul 2009 15:15:18 GMT
Author: mikedd
Date: Tue Jul 21 15:15:17 2009
New Revision: 796340

URL: http://svn.apache.org/viewvc?rev=796340&view=rev
Log:
OPENJPA-1171: 
Replace StringBuffer with StringBuilder in SQLBuffer to reduce synchronization

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java?rev=796340&r1=796339&r2=796340&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java Tue
Jul 21 15:15:17 2009
@@ -58,7 +58,7 @@
     private static final String PARAMETER_TOKEN = "?";
 
     private final DBDictionary _dict;
-    private final StringBuffer _sql = new StringBuffer();
+    private final StringBuilder _sql = new StringBuilder();
     private List _subsels = null;
     private List _params = null;
     private List _cols = null;
@@ -446,7 +446,7 @@
         if (!replaceParams || _params == null || _params.isEmpty())
             return sql;
 
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         Iterator pi = _params.iterator();
         for (int i = 0; i < sql.length(); i++) {
             if (sql.charAt(i) != '?') {



Mime
View raw message