openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r898168 [1/2] - in /openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ openjpa-jdbc/src/main/jav...
Date Tue, 12 Jan 2010 03:31:14 GMT
Author: dwoods
Date: Tue Jan 12 03:31:11 2010
New Revision: 898168

URL: http://svn.apache.org/viewvc?rev=898168&view=rev
Log:
OPENJPA-1456 Replace StringBuffer usage with StringBuilder for minor performance/scalability improvement

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/JDBCExpressionFactory.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/MatchesExpression.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/TypeLit.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/SequenceMapping.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StateComparisonVersionStrategy.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Column.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionaryFactory.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/IngresDictionary.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/JoinSet.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/RowImpl.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SybaseDictionary.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAVersion.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryKey.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/Concat.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/SequenceMetaData.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Exceptions.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginListValue.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/StringListValue.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DataSourceLogs.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingDatabaseMetaData.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/LoggingConnectionDecorator.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/SQLFormatter.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ClassArgParser.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/SourceTrackers.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Base16Encoder.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/CodeFormat.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/FormatPreservingProperties.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ParameterTemplate.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceUnitInfoImpl.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/MetamodelImpl.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/SourceAnnotationHandler.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/ArrayExpression.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/JoinPath.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/LocateExpression.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/NewInstance.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryDefinitionImpl.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/VarArgsExpression.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/WhenClause.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/util/SourceCode.java
    openjpa/trunk/openjpa-xmlstore/src/main/java/org/apache/openjpa/xmlstore/ObjectData.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java Tue Jan 12 03:31:11 2010
@@ -782,7 +782,7 @@
 
         Val value2 = concatVal.getVal2();
         Object val2 = getValue(value2, ob, params, sm);
-        return new StringBuffer(100).append(val1).append(val2).toString();
+        return new StringBuilder(100).append(val1).append(val2).toString();
     }
 
     private Object handleSubstringVal(Object value, Object ob, Object[] params,

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java Tue Jan 12 03:31:11 2010
@@ -373,7 +373,7 @@
             tok.wordChars('0', '9');
             tok.wordChars('?', '?');
 
-            StringBuffer buf = new StringBuffer(sql.length());
+            StringBuilder buf = new StringBuilder(sql.length());
             for (int ttype; (ttype = tok.nextToken()) !=
                     StreamTokenizer.TT_EOF;) {
                 switch (ttype) {

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/JDBCExpressionFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/JDBCExpressionFactory.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/JDBCExpressionFactory.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/JDBCExpressionFactory.java Tue Jan 12 03:31:11 2010
@@ -446,7 +446,7 @@
     private Value getLiteralRawString(Value val) {
         if (val instanceof Lit) {
             Lit lit = (Lit) val;
-            StringBuffer value = new StringBuffer();
+            StringBuilder value = new StringBuilder();
             int pType = lit.getParseType(); 
             if (pType == Literal.TYPE_SQ_STRING ||
                 pType == Literal.TYPE_STRING)

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/MatchesExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/MatchesExpression.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/MatchesExpression.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/MatchesExpression.java Tue Jan 12 03:31:11 2010
@@ -128,7 +128,7 @@
     private static String replaceEscape(String str, String from, String to,
         String escape) {
         String[] parts = Strings.split(str, from, Integer.MAX_VALUE);
-        StringBuffer repbuf = new StringBuffer();
+        StringBuilder repbuf = new StringBuilder();
         for (int i = 0; i < parts.length; i++) {
             if (i > 0) {
                 // if the previous part ended with an escape character, then

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java Tue Jan 12 03:31:11 2010
@@ -216,7 +216,7 @@
     }
     
     public String getXPath() {
-        StringBuffer xpath = new StringBuffer();
+        StringBuilder xpath = new StringBuilder();
         Action action;
         Iterator itr = _actions.iterator();
         
@@ -248,7 +248,7 @@
         if (_actions == null)
             return (_varName == null) ? "" : _varName + ".";
 
-        StringBuffer path = new StringBuffer();
+        StringBuilder path = new StringBuilder();
         Action action;
         for (Iterator itr = _actions.iterator(); itr.hasNext();) {
             action = (Action) itr.next();

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/TypeLit.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/TypeLit.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/TypeLit.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/TypeLit.java Tue Jan 12 03:31:11 2010
@@ -114,7 +114,7 @@
     }
 
     private String getDiscriminator(LitExpState lstate) {
-        StringBuffer disc = new StringBuffer(lstate.discValue.toString());
+        StringBuilder disc = new StringBuilder(lstate.discValue.toString());
         switch(lstate.disc.getJavaType()) {
         case JavaTypes.INT:
             return disc.toString();

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java Tue Jan 12 03:31:11 2010
@@ -1474,7 +1474,7 @@
      * name, using the default package.
      */
     private String getClassName(Table table) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         if (getPackageName() != null)
             buf.append(getPackageName()).append(".");
 
@@ -1514,7 +1514,7 @@
         else
             name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
 
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         String[] subs = Strings.split(name, "_", 0);
         for (int i = 0; i < subs.length; i++) {
             if (i > 0)
@@ -1571,7 +1571,7 @@
         if (StringUtils.isEmpty(str))
             return str;
 
-        StringBuffer buf = new StringBuffer(str);
+        StringBuilder buf = new StringBuilder(str);
         char c;
         for (int i = 0; i < buf.length(); i++) {
             c = buf.charAt(i);

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/SequenceMapping.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/SequenceMapping.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/SequenceMapping.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/SequenceMapping.java Tue Jan 12 03:31:11 2010
@@ -161,7 +161,7 @@
     }
 
     @Override
-    protected void addStandardProperties(StringBuffer props) {
+    protected void addStandardProperties(StringBuilder props) {
         super.addStandardProperties(props);
         // Quotes are conditionally added to the following because the props
         // are eventually passed to the Configurations.parseProperties()

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StateComparisonVersionStrategy.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StateComparisonVersionStrategy.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StateComparisonVersionStrategy.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StateComparisonVersionStrategy.java Tue Jan 12 03:31:11 2010
@@ -240,7 +240,7 @@
          */
         public String getSQL() {
             Column[] cols = getTable().getColumns();
-            StringBuffer buf = new StringBuffer();
+            StringBuilder buf = new StringBuilder();
             boolean hasWhere = false;
             Object val;
             for (int i = 0; i < cols.length; i++) {

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java Tue Jan 12 03:31:11 2010
@@ -499,7 +499,7 @@
                 // we know we don't need a union
                 Select sel = store.getSQLFactory().newSelect();
                 sel.setAggregate(true);
-                StringBuffer sql = new StringBuffer();
+                StringBuilder sql = new StringBuilder();
                 sql.append("MAX(").
                     append(sel.getColumnAlias(field.getOrderColumn())).
                     append(")");

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Column.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Column.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Column.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Column.java Tue Jan 12 03:31:11 2010
@@ -668,7 +668,7 @@
      * Useful for debugging.
      */
     public String getDescription() {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("Full Name: ").append(getFullName()).append("\n");
         buf.append("Type: ").append(Schemas.getJDBCName(getType())).
             append("\n");

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java Tue Jan 12 03:31:11 2010
@@ -231,7 +231,7 @@
     }
 
     protected String getSequencesSQL(String schemaName, String sequenceName) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append(sequenceSQL);
         if (schemaName != null || sequenceName != null)
             buf.append(" WHERE ");
@@ -381,7 +381,7 @@
         int isolationLevel;
         // For db2UDBV81OrEarlier and db2ISeriesV5R3OrEarlier:
         // "optimize for" clause appears before "for update" clause.
-        StringBuffer forUpdateString = new StringBuffer(getOptimizeClause(sel));
+        StringBuilder forUpdateString = new StringBuilder(getOptimizeClause(sel));
         // Determine the isolationLevel; the fetch
         // configuration data overrides the persistence.xml value
         if (fetch != null && fetch.getIsolation() != -1)
@@ -534,7 +534,7 @@
 
     protected String getOptimizeClause(Select sel) {
         if (sel != null && sel.getExpectedResultCount() > 0) {
-            StringBuffer buf = new StringBuffer();
+            StringBuilder buf = new StringBuilder();
             buf.append(" ").append(optimizeClause).append(" ")
                 .append(String.valueOf(sel.getExpectedResultCount()))
                 .append(" ").append(rowClause);
@@ -569,7 +569,7 @@
             getMethod("getSqlWarn", null);
             Method  getSqlErrdMethd = sqlca.getClass().
             getMethod("getSqlErrd", null);
-            StringBuffer errdStr = new StringBuffer();
+            StringBuilder errdStr = new StringBuilder();
 
             int[] errds = (int[]) getSqlErrdMethd.invoke(sqlca, new Object[]{});
             for (int i = 0; i < errds.length; i++)

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java Tue Jan 12 03:31:11 2010
@@ -1747,7 +1747,7 @@
 
         String size = null;
         if (col.getSize() > 0) {
-            StringBuffer buf = new StringBuffer(10);
+            StringBuilder buf = new StringBuilder(10);
             buf.append("(").append(col.getSize());
             if (col.getDecimalDigits() > 0)
                 buf.append(", ").append(col.getDecimalDigits());
@@ -3176,7 +3176,7 @@
         if (name == null || name.length() <= targetLength)
             return name;
 
-        StringBuffer nm = new StringBuffer(name);
+        StringBuilder nm = new StringBuilder(name);
         while (nm.length() > targetLength) {
             if (!stripVowel(nm)) {
                 // cut out the middle char
@@ -3191,7 +3191,8 @@
      *
      * @return true if any vowels have been removed
      */
-    private static boolean stripVowel(StringBuffer name) {
+    //private static boolean stripVowel(StringBuffer name) {
+    private static boolean stripVowel(StringBuilder name) {
         if (name == null || name.length() == 0)
             return false;
 
@@ -3336,7 +3337,7 @@
      * with columns. Indexes and constraints will be created separately.
      */
     public String[] getCreateTableSQL(Table table) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         String tableName = checkNameLength(getFullName(table, false), 
                 maxTableNameLength, "long-table-name");
         buf.append("CREATE TABLE ").append(tableName);
@@ -3350,7 +3351,7 @@
 
         // do this before getting the columns so we know how to handle
         // the last comma
-        StringBuffer endBuf = new StringBuffer();
+        StringBuilder endBuf = new StringBuilder();
         PrimaryKey pk = table.getPrimaryKey();
         String pkStr;
         if (pk != null) {
@@ -3390,7 +3391,8 @@
         return batchFetchSize;
     }
 
-    protected StringBuffer comment(StringBuffer buf, String comment) {
+    //protected StringBuffer comment(StringBuffer buf, String comment) {
+    protected StringBuilder comment(StringBuilder buf, String comment) {
         return buf.append("-- ").append(comment);
     }
 
@@ -3414,7 +3416,7 @@
         if (nextSequenceQuery == null)
             return null;
 
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("CREATE SEQUENCE ");
         String seqName = checkNameLength(getFullName(seq), maxTableNameLength, 
                 "long-seq-name");
@@ -3440,7 +3442,7 @@
      * (&lt;col list&gt;)</code> by default.
      */
     public String[] getCreateIndexSQL(Index index) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("CREATE ");
         if (index.isUnique())
             buf.append("UNIQUE ");
@@ -3562,7 +3564,7 @@
      * {@link #getAddColumnSQL}.
      */
     protected String getDeclareColumnSQL(Column col, boolean alter) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         String columnName = checkNameLength(col.getName(), maxColumnNameLength, 
                 "long-column-name");
         buf.append(columnName).append(" ");
@@ -3601,7 +3603,7 @@
         if (name != null && reservedWordSet.contains(name.toUpperCase()))
             name = null;
 
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         if (name != null && CONS_NAME_BEFORE.equals(constraintNameMode))
             buf.append("CONSTRAINT ").append(name).append(" ");
         buf.append("PRIMARY KEY ");
@@ -3649,7 +3651,7 @@
         String delAction = getActionName(delActionId);
         String upAction = getActionName(fk.getUpdateAction());
 
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         if (fk.getName() != null
             && CONS_NAME_BEFORE.equals(constraintNameMode))
             buf.append("CONSTRAINT ").append(fk.getName()).append(" ");
@@ -3754,7 +3756,7 @@
         if (!supportsUniqueConstraints
             || (unq.isDeferred() && !supportsDeferredUniqueConstraints()))
             return null;
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         if (unq.getName() != null
             && CONS_NAME_BEFORE.equals(constraintNameMode))
             buf.append("CONSTRAINT ").append(checkNameLength(unq.getName(), 
@@ -4378,7 +4380,7 @@
             // this assumes that tname is longer than extraChars
             tname = tname.substring(0, tname.length() - extraChars);
         }
-        StringBuffer buf = new StringBuffer(max);
+        StringBuilder buf = new StringBuilder(max);
         buf.append(tname).append("_").append(cname).append("_SEQ");
         return buf.toString();
     }

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionaryFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionaryFactory.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionaryFactory.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionaryFactory.java Tue Jan 12 03:31:11 2010
@@ -296,7 +296,7 @@
     public static String toString(DatabaseMetaData meta)
         throws SQLException {
         String lineSep = J2DoPrivHelper.getLineSeparator();
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder(4096);
         try {
             buf.append("catalogSeparator: ")
                 .append(meta.getCatalogSeparator())

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java Tue Jan 12 03:31:11 2010
@@ -118,7 +118,7 @@
     }
 
     public String[] getCreateTableSQL(Table table) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("CREATE TABLE ").append(getFullName(table, false))
             .append(" (");
 
@@ -161,7 +161,7 @@
     }
 
     protected String getSequencesSQL(String schemaName, String sequenceName) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("SELECT SEQUENCE_SCHEMA, SEQUENCE_NAME FROM ")
             .append("INFORMATION_SCHEMA.SEQUENCES");
         if (schemaName != null || sequenceName != null)

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java Tue Jan 12 03:31:11 2010
@@ -134,7 +134,7 @@
     }
 
     public String[] getCreateTableSQL(Table table) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("CREATE ");
         if (cacheTables)
             buf.append("CACHED ");
@@ -179,7 +179,7 @@
     }
 
     protected String getSequencesSQL(String schemaName, String sequenceName) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("SELECT SEQUENCE_SCHEMA, SEQUENCE_NAME FROM ").
             append("INFORMATION_SCHEMA.SYSTEM_SEQUENCES");
         if (schemaName != null || sequenceName != null)

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/IngresDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/IngresDictionary.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/IngresDictionary.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/IngresDictionary.java Tue Jan 12 03:31:11 2010
@@ -210,7 +210,7 @@
      */
     @Override
     protected String getSequencesSQL(String schemaName, String sequenceName) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append(sequenceSQL);
         if (schemaName != null || sequenceName != null)
             buf.append(" WHERE ");

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/JoinSet.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/JoinSet.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/JoinSet.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/JoinSet.java Tue Jan 12 03:31:11 2010
@@ -345,7 +345,7 @@
     }
 
     public String toString() {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("[");
         for (Iterator itr = iterator(); itr.hasNext();) {
             buf.append("<").append(itr.next()).append(">");

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java Tue Jan 12 03:31:11 2010
@@ -288,7 +288,7 @@
         if (!optimizeMultiTableDeletes)
             return super.getDeleteTableContentsSQL(tables,conn);
         else {
-            StringBuffer buf = new StringBuffer(tables.length * 8);
+            StringBuilder buf = new StringBuilder(tables.length * 8);
             buf.append("DELETE FROM ");
             for (int i = 0; i < tables.length; i++) {
                 buf.append(tables[i].getFullName());

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java Tue Jan 12 03:31:11 2010
@@ -668,7 +668,7 @@
     public PrimaryKey[] getPrimaryKeys(DatabaseMetaData meta,
         String catalog, String schemaName, String tableName, Connection conn)
         throws SQLException {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("SELECT t0.OWNER AS TABLE_SCHEM, ").
             append("t0.TABLE_NAME AS TABLE_NAME, ").
             append("t0.COLUMN_NAME AS COLUMN_NAME, ").
@@ -714,7 +714,7 @@
         String schemaName, String tableName, boolean unique, boolean approx,
         Connection conn)
         throws SQLException {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("SELECT t0.INDEX_OWNER AS TABLE_SCHEM, ").
             append("t0.TABLE_NAME AS TABLE_NAME, ").
             append("DECODE(t1.UNIQUENESS, 'UNIQUE', 0, 'NONUNIQUE', 1) ").
@@ -760,7 +760,7 @@
     public ForeignKey[] getImportedKeys(DatabaseMetaData meta, String catalog,
         String schemaName, String tableName, Connection conn, boolean partialKeys)
         throws SQLException {
-        StringBuffer delAction = new StringBuffer("DECODE(t1.DELETE_RULE").
+        StringBuilder delAction = new StringBuilder("DECODE(t1.DELETE_RULE").
             append(", 'NO ACTION', ").append(meta.importedKeyNoAction).
             append(", 'RESTRICT', ").append(meta.importedKeyRestrict).
             append(", 'CASCADE', ").append(meta.importedKeyCascade).
@@ -768,7 +768,7 @@
             append(", 'SET DEFAULT', ").append(meta.importedKeySetDefault).
             append(")");
 
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("SELECT t2.OWNER AS PKTABLE_SCHEM, ").
             append("t2.TABLE_NAME AS PKTABLE_NAME, ").
             append("t2.COLUMN_NAME AS PKCOLUMN_NAME, ").
@@ -902,7 +902,7 @@
 
 
     protected String getSequencesSQL(String schemaName, String sequenceName) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("SELECT SEQUENCE_OWNER AS SEQUENCE_SCHEMA, ").
             append("SEQUENCE_NAME FROM ALL_SEQUENCES");
         if (schemaName != null || sequenceName != null)

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/RowImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/RowImpl.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/RowImpl.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/RowImpl.java Tue Jan 12 03:31:11 2010
@@ -747,7 +747,7 @@
      * Return the SQL for a prepared statement update on this row.
      */
     private String getUpdateSQL(DBDictionary dict) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("UPDATE ").append(dict.getFullName(getTable(), false)).
             append(" SET ");
 
@@ -774,8 +774,8 @@
      * Return the SQL for a prepared statement insert on this row.
      */
     private String getInsertSQL(DBDictionary dict) {
-        StringBuffer buf = new StringBuffer();
-        StringBuffer vals = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
+        StringBuilder vals = new StringBuilder();
         buf.append("INSERT INTO ").
             append(dict.getFullName(getTable(), false)).append(" (");
 
@@ -804,7 +804,7 @@
      * Return the SQL for a prepared statement delete on this row.
      */
     private String getDeleteSQL(DBDictionary dict) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("DELETE FROM ").
             append(dict.getFullName(getTable(), false));
         appendWhere(buf, dict);
@@ -814,7 +814,7 @@
     /**
      * Appends the where clause onto the given sql buffer.
      */
-    private void appendWhere(StringBuffer buf, DBDictionary dict) {
+    private void appendWhere(StringBuilder buf, DBDictionary dict) {
         boolean hasWhere = false;
         for (int i = 0; i < _cols.length; i++) {
             if (_vals[getWhereIndex(_cols[i])] == null)

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java Tue Jan 12 03:31:11 2010
@@ -715,7 +715,7 @@
                 else if (join.getTable2() == table)
                     tableAlias = join.getAlias2();
                 if (tableAlias != null)
-                    return new StringBuffer(tableAlias).append(".").
+                    return new StringBuilder(tableAlias).append(".").
                         append(columnName).toString();
             }
         }
@@ -2147,7 +2147,7 @@
         return false;
     }
 
-    public StringBuffer path() {
+    public StringBuilder path() {
         return null;
     }
 
@@ -2339,7 +2339,7 @@
                 return this;
 
             PathJoinsImpl pj = new PathJoinsImpl();
-            pj.path = new StringBuffer(pre.path().toString());
+            pj.path = new StringBuilder(pre.path().toString());
             return pj;
         }
 
@@ -2500,7 +2500,7 @@
             return false;
         }
 
-        public StringBuffer path() {
+        public StringBuilder path() {
             return null;
         }
 
@@ -2577,7 +2577,7 @@
     private static class PathJoinsImpl
         implements PathJoins {
 
-        protected StringBuffer path = null;
+        protected StringBuilder path = null;
         protected String var = null;
         protected String correlatedVar = null;
         protected Context context = null;
@@ -2599,7 +2599,7 @@
             return var != null || path != null;
         }
 
-        public StringBuffer path() {
+        public StringBuilder path() {
             return path;
         }
 
@@ -2683,7 +2683,7 @@
         protected void append(String str) {
             if (str != null) {
                 if (path == null)
-                    path = new StringBuffer(str);
+                    path = new StringBuilder(str);
                 else
                     path.append('.').append(str);
             }
@@ -2971,7 +2971,7 @@
             SelectJoins sj = new SelectJoins(sel);
             sj.var = var;
             if (path != null)
-                sj.path = new StringBuffer(path.toString());
+                sj.path = new StringBuilder(path.toString());
             if (_joins != null && !_joins.isEmpty())
                 sj._joins = new JoinSet(_joins);
             sj._outer = _outer;
@@ -3221,7 +3221,7 @@
     /**
      * Return the relation path traversed by these joins, or null if none.
      */
-    public StringBuffer path();
+    public StringBuilder path();
 
     /**
      * Return the set of {@link Join} elements, or null if none.

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SybaseDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SybaseDictionary.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SybaseDictionary.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SybaseDictionary.java Tue Jan 12 03:31:11 2010
@@ -194,7 +194,7 @@
         if (!createIdentityColumn)
             return super.getCreateTableSQL(table);
 
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("CREATE TABLE ").append(getFullName(table, false)).
             append(" (");
 
@@ -231,7 +231,7 @@
     }
 
     protected String getDeclareColumnSQL(Column col, boolean alter) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append(col).append(" ");
         buf.append(getTypeName(col));
 

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAVersion.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAVersion.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAVersion.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAVersion.java Tue Jan 12 03:31:11 2010
@@ -99,7 +99,7 @@
     }
 
     public String toString() {
-        StringBuffer buf = new StringBuffer(80 * 30);
+        StringBuilder buf = new StringBuilder(80 * 40);
         appendOpenJPABanner(buf);
         buf.append("\n");
 
@@ -124,7 +124,7 @@
         return buf.toString();
     }
 
-    public void appendOpenJPABanner(StringBuffer buf) {
+    public void appendOpenJPABanner(StringBuilder buf) {
         buf.append(VENDOR_NAME).append(" ");
         buf.append(VERSION_NUMBER);
         buf.append("\n");
@@ -134,7 +134,7 @@
         buf.append("\n");
     }
 
-    private StringBuffer appendProperty(String prop, StringBuffer buf) {
+    private StringBuilder appendProperty(String prop, StringBuilder buf) {
         return buf.append(prop).append(": ").append(
             AccessController.doPrivileged(J2DoPrivHelper
                 .getPropertyAction(prop)));

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryKey.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryKey.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryKey.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryKey.java Tue Jan 12 03:31:11 2010
@@ -429,7 +429,7 @@
     }
 
     public String toString() {
-        StringBuffer buf = new StringBuffer(255);
+        StringBuilder buf = new StringBuilder(1024);
         buf.append(super.toString()).
             append("[query:[").append(_query).append("]").
             append(",access path:").append(_accessPathClassNames).

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java Tue Jan 12 03:31:11 2010
@@ -1100,7 +1100,7 @@
             append("b == null").closeParen().endl();
         code.tab(3).append("return \"null\";").endl(2);
 
-        code.tab(2).append("StringBuffer r = new StringBuffer").
+        code.tab(2).append("StringBuilder r = new StringBuilder").
             openParen(true).append("b.length * 2").closeParen().
             append(";").endl();
         code.tab(2).append("for").openParen(true).

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java Tue Jan 12 03:31:11 2010
@@ -888,7 +888,7 @@
             return;
 
         String sep = J2DoPrivHelper.getLineSeparator();
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         for (Iterator itr = _violations.iterator(); itr.hasNext();) {
             buf.append(itr.next());
             if (itr.hasNext())

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java Tue Jan 12 03:31:11 2010
@@ -623,7 +623,7 @@
             if (log.isTraceEnabled()) {
                 Map<String,Object> props = _conf.toProperties(true);
                 String lineSep = J2DoPrivHelper.getLineSeparator();
-                StringBuffer buf = new StringBuffer();
+                StringBuilder buf = new StringBuilder();
                 Map.Entry<?,?> entry;
                 for (Iterator<Map.Entry<String,Object>> itr = props.entrySet().iterator(); itr.hasNext();) {
                     entry = itr.next();

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java Tue Jan 12 03:31:11 2010
@@ -917,7 +917,7 @@
         List<FetchConfigurationImpl> path = getPath();
         if (path.isEmpty())
             return "";
-        StringBuffer buf = new StringBuffer().append (": ");
+        StringBuilder buf = new StringBuilder().append (": ");
         for (Iterator<FetchConfigurationImpl> itr = path.iterator(); itr.hasNext();) {
             buf.append(itr.next().getTraversedFromField());
             if (itr.hasNext())

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java Tue Jan 12 03:31:11 2010
@@ -1772,7 +1772,7 @@
 
 
     public String toString() {
-        StringBuffer buf = new StringBuffer(64);
+        StringBuilder buf = new StringBuilder(255);
         buf.append("Query: ").append(super.toString());
         buf.append("; candidate class: ").append(_class);
         buf.append("; query: ").append(_query);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/Concat.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/Concat.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/Concat.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/Concat.java Tue Jan 12 03:31:11 2010
@@ -50,7 +50,7 @@
     protected Object eval(Object candidate, Object orig,
         StoreContext ctx, Object[] params) {
         Object str = _val.eval(candidate, orig, ctx, params);
-        StringBuffer cat = new StringBuffer(str.toString());
+        StringBuilder cat = new StringBuilder(str.toString());
 
         Object arg = _args.eval(candidate, orig, ctx, params);
         if (arg instanceof Object[]) {

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java Tue Jan 12 03:31:11 2010
@@ -327,7 +327,7 @@
      * child, separated by the delimiter.
      */
     private static String assemble(JPQLNode node, String delimiter, int last) {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         JPQLNode[] parts = node.children;
         for (int i = 0; parts != null && i < parts.length - last; i++)
             result.append(result.length() > 0 ? delimiter : "").

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java Tue Jan 12 03:31:11 2010
@@ -1207,7 +1207,7 @@
      */
     public String getOrderDeclaration() {
         if (_orderDec == null && _orders != null) {
-            StringBuffer buf = new StringBuffer();
+            StringBuilder buf = new StringBuilder();
             for (int i = 0; i < _orders.length; i++) {
                 if (i > 0)
                     buf.append(", ");

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java Tue Jan 12 03:31:11 2010
@@ -573,7 +573,7 @@
      * Return a string representation of the given mode flags.
      */
     private static String toModeString(int mode) {
-        StringBuffer buf = new StringBuffer(31);
+        StringBuilder buf = new StringBuilder(31);
         if ((mode & MODE_META) != 0)
             buf.append("[META]");
         if ((mode & MODE_QUERY) != 0)

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/SequenceMetaData.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/SequenceMetaData.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/SequenceMetaData.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/SequenceMetaData.java Tue Jan 12 03:31:11 2010
@@ -279,7 +279,7 @@
             Class cls = Class.forName(clsName, true,
                 AccessController.doPrivileged(
                     J2DoPrivHelper.getClassLoaderAction(Seq.class)));
-            StringBuffer props = new StringBuffer();
+            StringBuilder props = new StringBuilder();
             if (plugin.getProperties() != null)
                 props.append(plugin.getProperties());
             addStandardProperties(props);
@@ -343,7 +343,7 @@
     /**
      * Add standard properties to the given properties buffer.
      */
-    protected void addStandardProperties(StringBuffer props) {
+    protected void addStandardProperties(StringBuilder props) {
         appendProperty(props, PROP_SEQUENCE, wrapValue(_sequence));
         appendProperty(props, PROP_INITIAL_VALUE, _initial);
         appendProperty(props, PROP_ALLOCATE, _allocate);
@@ -367,7 +367,7 @@
      * Add a string property to the buffer. Nothing will be added if value
      * is null or empty string.
      */
-    protected void appendProperty(StringBuffer props, String name, String val) {
+    protected void appendProperty(StringBuilder props, String name, String val) {
         if (StringUtils.isEmpty(val))
             return;
         if (props.length() > 0)
@@ -378,7 +378,7 @@
     /**
      * Add an int property to the buffer. Nothing will be added if value is -1.
      */
-    protected void appendProperty(StringBuffer props, String name, int val) {
+    protected void appendProperty(StringBuilder props, String name, int val) {
         if (val == -1)
             return;
         if (props.length() > 0)

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Exceptions.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Exceptions.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Exceptions.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Exceptions.java Tue Jan 12 03:31:11 2010
@@ -121,7 +121,7 @@
      * Safely stringify the given objects.
      */
     public static String toString(Collection failed) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("[");
         for (Iterator itr = failed.iterator(); itr.hasNext();) {
             buf.append(Exceptions.toString(itr.next()));
@@ -137,7 +137,7 @@
      */
     public static String toString(ExceptionInfo e) {
         int type = e.getType();
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("<").
             append(OpenJPAVersion.VERSION_ID).
             append(' ').

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java Tue Jan 12 03:31:11 2010
@@ -916,7 +916,7 @@
     public static String toXMLName(String propName) {
         if (propName == null)
             return null;
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         char c;
         for (int i = 0; i < propName.length(); i++) {
             c = propName.charAt(i);

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java Tue Jan 12 03:31:11 2010
@@ -527,7 +527,7 @@
         if (map == null || map.isEmpty())
             return null;
 
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         Map.Entry entry;
         String val;
         for (Iterator itr = map.entrySet().iterator(); itr.hasNext();) {
@@ -584,7 +584,7 @@
                     val = val.substring(1, val.length() - 1);
                 else if (val.startsWith("\"") || val.startsWith("'")) {
                     quote = val.charAt(0);
-                    StringBuffer buf = new StringBuffer(val.substring(1));
+                    StringBuilder buf = new StringBuilder(val.substring(1));
                     int quotIdx;
                     while (++i < props.length) {
                         buf.append(",");

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginListValue.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginListValue.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginListValue.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginListValue.java Tue Jan 12 03:31:11 2010
@@ -106,7 +106,7 @@
         if (_names.length == 0)
             return null;
 
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         for (int i = 0; i < _names.length; i++) {
             if (i > 0)
                 buf.append(", ");
@@ -136,7 +136,7 @@
         // split up the string; each element might be a class name, or a
         // class name with properties settings
         List<String> plugins = new ArrayList<String>();
-        StringBuffer plugin = new StringBuffer();
+        StringBuilder plugin = new StringBuilder();
         boolean inParen = false;
         char c;
         for (int i = 0; i < str.length(); i++) {
@@ -155,7 +155,7 @@
                         plugin.append(c);
                     else {
                         plugins.add(plugin.toString());
-                        plugin = new StringBuffer();
+                        plugin = new StringBuilder();
                     }
                     break;
                 default:

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java Tue Jan 12 03:31:11 2010
@@ -266,7 +266,7 @@
             loader = AccessController.doPrivileged(
                 J2DoPrivHelper.getContextClassLoaderAction());
         ConfigurationProvider provider = null;
-        StringBuffer errs = null;
+        StringBuilder errs = null;
         // most specific to least
         Throwable err = null;
         for (int i = _derivations.length - 1; i >= 0; i--) {
@@ -276,7 +276,7 @@
                     return provider;
             } catch (Throwable t) {
                 err = t;
-                errs = (errs == null) ? new StringBuffer() : errs.append("\n");
+                errs = (errs == null) ? new StringBuilder() : errs.append("\n");
                 errs.append(_derivations[i].getClass().getName() + ":" + t);
             }
         }
@@ -301,7 +301,7 @@
             loader = AccessController.doPrivileged(
                 J2DoPrivHelper.getContextClassLoaderAction());
         ConfigurationProvider provider = null;
-        StringBuffer errs = null;
+        StringBuilder errs = null;
         Throwable err = null;
         // most specific to least
         for (int i = _derivations.length - 1; i >= 0; i--) {
@@ -311,7 +311,7 @@
                     return provider;
             } catch (Throwable t) {
                 err = t;
-                errs = (errs == null) ? new StringBuffer() : errs.append("\n");
+                errs = (errs == null) ? new StringBuilder() : errs.append("\n");
                 errs.append(_derivations[i].getClass().getName() + ":" + t);
             }
         }
@@ -348,7 +348,7 @@
                 J2DoPrivHelper.getContextClassLoaderAction());
         
         ConfigurationProvider provider = null;
-        StringBuffer errs = null;
+        StringBuilder errs = null;
         String type = (globals) ? "globals" : "defaults";
         Throwable err = null;
         // most specific to least
@@ -360,7 +360,7 @@
                    return provider;
             } catch (Throwable t) {
                 err = t;
-                errs = (errs == null) ? new StringBuffer() : errs.append("\n");
+                errs = (errs == null) ? new StringBuilder() : errs.append("\n");
                 errs.append(_derivations[i].getClass().getName() + ":" + t);
             }
         }
@@ -371,7 +371,7 @@
     /**
      * Thrown proper exception for given errors.
      */
-    private static void reportErrors(StringBuffer errs, String resource,
+    private static void reportErrors(StringBuilder errs, String resource,
         Throwable nested) {
         if (errs == null)
             return;
@@ -392,7 +392,7 @@
     public static List<String> getFullyQualifiedAnchorsInPropertiesLocation(
         final String propertiesLocation) {
         List<String> fqAnchors = new ArrayList<String>();
-        StringBuffer errs = null;
+        StringBuilder errs = null;
         Throwable err = null;
         for (int i = _derivations.length - 1; i >= 0; i--) {
             try {
@@ -423,7 +423,7 @@
                 }
             } catch (Throwable t) {
                 err = t;
-                errs = (errs == null) ? new StringBuffer() : errs.append("\n");
+                errs = (errs == null) ? new StringBuilder() : errs.append("\n");
                 errs.append(_derivations[i].getClass().getName() + ":" + t);
             }
         }
@@ -484,7 +484,7 @@
      * Return a message about the status of each product derivation.
      */
     private static String derivationErrorsToString() {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append("ProductDerivations: ").append(_derivationNames.length);
         for (int i = 0; i < _derivationNames.length; i++) {
             buf.append("\n").append(i + 1).append(". ").

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/StringListValue.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/StringListValue.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/StringListValue.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/StringListValue.java Tue Jan 12 03:31:11 2010
@@ -88,7 +88,7 @@
         // canonical values.  Also, catch any bad aliases.
         boolean found;
         String iString;
-        StringBuffer retv = new StringBuffer();
+        StringBuilder retv = new StringBuilder();
         String[] vals = str.split(",", 0);
         
         for (int i = 0; i < vals.length; i++) {

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DataSourceLogs.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DataSourceLogs.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DataSourceLogs.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DataSourceLogs.java Tue Jan 12 03:31:11 2010
@@ -132,7 +132,7 @@
         if (startTime != -1)
             totalTime = System.currentTimeMillis() - startTime;
 
-        StringBuffer buf = new StringBuffer(25 + msg.length());
+        StringBuilder buf = new StringBuilder(25 + msg.length());
         buf.append("<t ").append(Thread.currentThread().hashCode());
         if (conn != null)
             buf.append(", ").append(conn);

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingDatabaseMetaData.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingDatabaseMetaData.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingDatabaseMetaData.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingDatabaseMetaData.java Tue Jan 12 03:31:11 2010
@@ -85,7 +85,7 @@
     }
 
     public String toString() {
-        StringBuffer buf = new StringBuffer("metadata ").append(hashCode());
+        StringBuilder buf = new StringBuilder("metadata ").append(hashCode());
         buf.append("[").append(_metaData.toString()).append("]");
         return buf.toString();
     }

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/LoggingConnectionDecorator.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/LoggingConnectionDecorator.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/LoggingConnectionDecorator.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/LoggingConnectionDecorator.java Tue Jan 12 03:31:11 2010
@@ -1345,9 +1345,9 @@
                     buf.append(_sql);
                 }
 
-                StringBuffer paramBuf = null;
+                StringBuilder paramBuf = null;
                 if (_params != null && !_params.isEmpty()) {
-                    paramBuf = new StringBuffer();
+                    paramBuf = new StringBuilder();
                     for (Iterator<String> itr = _params.iterator(); itr
                         .hasNext();) {
                         paramBuf.append(itr.next());
@@ -1928,9 +1928,9 @@
                     buf.append(_sql);
                 }
 
-                StringBuffer paramBuf = null;
+                StringBuilder paramBuf = null;
                 if (_params != null && !_params.isEmpty()) {
-                    paramBuf = new StringBuffer();
+                    paramBuf = new StringBuilder();
                     for (Iterator<String> itr = _params.iterator(); itr
                         .hasNext();) {
                         paramBuf.append(itr.next());

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/SQLFormatter.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/SQLFormatter.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/SQLFormatter.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/SQLFormatter.java Tue Jan 12 03:31:11 2010
@@ -136,8 +136,8 @@
         if (!multiLine) {
             return prettyPrintLine(sqlObject);
         } else {
-            StringBuffer sql = new StringBuffer(sqlObject.toString());
-            StringBuffer buf = new StringBuffer(sql.length());
+            StringBuilder sql = new StringBuilder(sqlObject.toString());
+            StringBuilder buf = new StringBuilder(sql.length());
 
             while (sql.length() > 0) {
                 String line = null;
@@ -183,9 +183,9 @@
 
         int start = 0;
         int end = -1;
-        StringBuffer clause;
-        List<StringBuffer> clauses = new ArrayList<StringBuffer>();
-        clauses.add(new StringBuffer());
+        StringBuilder clause;
+        List<StringBuilder> clauses = new ArrayList<StringBuilder>();
+        clauses.add(new StringBuilder());
         for (int i = 0; i < separators.length; i++) {
             end = lowerCaseSql.indexOf(" " + separators[i].toLowerCase(),
                 start);
@@ -195,7 +195,7 @@
             clause = clauses.get(clauses.size() - 1);
             clause.append(sql.substring(start, end));
 
-            clause = new StringBuffer();
+            clause = new StringBuilder();
             clauses.add(clause);
             clause.append(clauseIndent);
             clause.append(separators[i]);
@@ -206,8 +206,8 @@
         clause = clauses.get(clauses.size() - 1);
         clause.append(sql.substring(start));
 
-        StringBuffer pp = new StringBuffer(sql.length());
-        for (Iterator<StringBuffer> iter = clauses.iterator(); iter.hasNext();){
+        StringBuilder pp = new StringBuilder(sql.length());
+        for (Iterator<StringBuilder> iter = clauses.iterator(); iter.hasNext();){
             pp.append(wrapLine(iter.next().toString()));
             if (iter.hasNext())
                 pp.append(newline);
@@ -217,7 +217,7 @@
     }
 
     private String wrapLine(String line) {
-        StringBuffer lines = new StringBuffer(line.length());
+        StringBuilder lines = new StringBuilder(line.length());
 
         // ensure that any leading whitespace is preserved.
         for (int i = 0; i < line.length() &&

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java Tue Jan 12 03:31:11 2010
@@ -316,12 +316,12 @@
          */
         protected String formatMessage(short level, String message,
             Throwable t) {
-            // we write to a StringBuffer and then flush it all at
+            // we write to a StringBuilder and then flush it all at
             // once as a single line, since some environments(e.g., JBoss)
             // override the System output stream to flush any calls
             // to write without regard to line breaks, making the
             // output incomprehensibe.
-            StringBuffer buf = new StringBuffer();
+            StringBuilder buf = new StringBuilder();
 
             buf.append(getOffset());
             buf.append("  ");

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ClassArgParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ClassArgParser.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ClassArgParser.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ClassArgParser.java Tue Jan 12 03:31:11 2010
@@ -338,14 +338,14 @@
             // find the line with the package declaration
             in = new BufferedReader(new FileReader(file));
             String line;
-            StringBuffer pack = null;
+            StringBuilder pack = null;
             while ((line = in.readLine()) != null) {
                 line = line.trim();
                 if (line.startsWith("package ")) {
                     line = line.substring(8).trim();
 
                     // strip off anything beyond the package declaration
-                    pack = new StringBuffer();
+                    pack = new StringBuilder();
                     for (int i = 0; i < line.length(); i++) {
                         if (Character.isJavaIdentifierPart(line.charAt(i))
                             || line.charAt(i) == '.')
@@ -579,7 +579,7 @@
      * Read the current text value until the next element.
      */
     private String readElementText(Reader in) throws IOException {
-        StringBuffer buf = null;
+        StringBuilder buf = null;
         int ch;
         while (true) {
             ch = in.read();
@@ -590,7 +590,7 @@
             if (Character.isWhitespace((char) ch))
                 continue;
             if (buf == null)
-                buf = new StringBuffer();
+                buf = new StringBuilder();
             buf.append((char) ch);
         }
         return (buf == null) ? "" : buf.toString();
@@ -612,7 +612,7 @@
      * Return the current attribute value.
      */
     private String readAttributeValue(Reader in) throws IOException {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         int ch;
         while (true) {
             ch = in.read();

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/SourceTrackers.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/SourceTrackers.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/SourceTrackers.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/SourceTrackers.java Tue Jan 12 03:31:11 2010
@@ -43,7 +43,7 @@
      * be provided.
      */
     public static String getSourceLocationMessage(SourceTracker[] trackers) {
-        StringBuffer buf = new StringBuffer(20 * (trackers.length + 1));
+        StringBuilder buf = new StringBuilder(20 * (trackers.length + 1));
         buf.append(_loc.get("source-trackers-location-header")).append(SEP);
         String sourceFilePath;
         for (int i = 0; i < trackers.length; i++) {

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Base16Encoder.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Base16Encoder.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Base16Encoder.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Base16Encoder.java Tue Jan 12 03:31:11 2010
@@ -34,7 +34,7 @@
      * Convert bytes to a base16 string.
      */
     public static String encode(byte[] byteArray) {
-        StringBuffer hexBuffer = new StringBuffer(byteArray.length * 2);
+        StringBuilder hexBuffer = new StringBuilder(byteArray.length * 2);
         for (int i = 0; i < byteArray.length; i++)
             for (int j = 1; j >= 0; j--)
                 hexBuffer.append(HEX[(byteArray[i] >> (j * 4)) & 0xF]);

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/CodeFormat.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/CodeFormat.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/CodeFormat.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/CodeFormat.java Tue Jan 12 03:31:11 2010
@@ -54,7 +54,7 @@
         if (tab == 0)
             _tab = "\t";
         else {
-            StringBuffer tabs = new StringBuffer(tab);
+            StringBuilder tabs = new StringBuilder(tab);
             for (int i = 0; i < tab; i++)
                 tabs.append(" ");
             _tab = tabs.toString();
@@ -167,7 +167,7 @@
         if (num == 1)
             return _sep;
 
-        StringBuffer buf = new StringBuffer(_sep.length() * num);
+        StringBuilder buf = new StringBuilder(_sep.length() * num);
         for (int i = 0; i < num; i++)
             buf.append(_sep);
         return buf.toString();
@@ -302,7 +302,7 @@
         if (tabLevel == 1)
             return _tab;
 
-        StringBuffer tabs = new StringBuffer(_tab.length() * tabLevel);
+        StringBuilder tabs = new StringBuilder(_tab.length() * tabLevel);
         for (int i = 0; i < tabLevel; i++)
             tabs.append(_tab);
         return tabs.toString();
@@ -313,7 +313,7 @@
      * Returns parametrized type string for given type(s).
      */
     public String getParametrizedType(String[] typenames) {
-        StringBuffer buf = new StringBuffer ();
+        StringBuilder buf = new StringBuilder();
         buf.append("<");
         for (int i = 0; i < typenames.length; i++) {
             if (i > 0)

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/FormatPreservingProperties.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/FormatPreservingProperties.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/FormatPreservingProperties.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/FormatPreservingProperties.java Tue Jan 12 03:31:11 2010
@@ -311,7 +311,7 @@
                 || line.charAt(pos) == '#' || line.charAt(pos) == '!')
                 continue;
 
-            StringBuffer key = new StringBuffer();
+            StringBuilder key = new StringBuilder();
             while (pos < line.length() && !isSpace(c = line.charAt(pos++))
                 && c != '=' && c != ':') {
                 if (c == '\\') {
@@ -341,7 +341,7 @@
                     pos++;
             }
 
-            StringBuffer element = new StringBuffer(line.length() - pos);
+            StringBuilder element = new StringBuilder(line.length() - pos);
 
             while (pos < line.length()) {
                 c = line.charAt(pos++);
@@ -385,7 +385,7 @@
      * @param value the value we are appending to
      * @return the position after the reading is done
      */
-    private static int readEscape(String source, int pos, StringBuffer value) {
+    private static int readEscape(String source, int pos, StringBuilder value) {
         char c = source.charAt(pos++);
         switch (c) {
             case 'n':
@@ -485,7 +485,7 @@
 
     private boolean writeProperty(String key, PrintWriter writer,
         boolean needsNewline) {
-        StringBuffer s = new StringBuffer();
+        StringBuilder s = new StringBuilder();
 
         if (key == null)
             return false;
@@ -517,7 +517,7 @@
      * @param isKey if true, then the string is a Property key, otherwise
      * it is a value
      */
-    private static void formatValue(String str, StringBuffer buf,
+    private static void formatValue(String str, StringBuilder buf,
         boolean isKey) {
         if (isKey) {
             buf.setLength(0);
@@ -569,7 +569,7 @@
      */
     private class PropertyLine implements Serializable {
 
-        private final StringBuffer line = new StringBuffer();
+        private final StringBuilder line = new StringBuilder();
         private String propertyKey;
         private String propertyValue;
 

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ParameterTemplate.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ParameterTemplate.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ParameterTemplate.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ParameterTemplate.java Tue Jan 12 03:31:11 2010
@@ -199,14 +199,14 @@
         if (_buf.length() == 0 || _params.isEmpty())
             return _buf.toString();
 
-        StringBuffer copy = new StringBuffer();
-        StringBuffer param = null;
+        StringBuilder copy = new StringBuilder();
+        StringBuilder param = null;
         char ch, last = 0;
         for (int i = 0; i < _buf.length(); i++) {
             ch = _buf.charAt(i);
             if (last == '$' && ch == '{') {
                 copy.deleteCharAt(copy.length() - 1);
-                param = new StringBuffer();
+                param = new StringBuilder();
             } else if (ch == '}' && param != null) {
                 if (_params.containsKey(param.toString()))
                     copy.append(_params.get(param.toString()));

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java Tue Jan 12 03:31:11 2010
@@ -434,11 +434,11 @@
      * Ensure all fields have declared a strategy.
      */
     private void validateStrategies(ClassMetaData meta) {
-        StringBuffer buf = null;
+        StringBuilder buf = null;
         for (FieldMetaData fmd : meta.getDeclaredFields()) {
             if (!fmd.isExplicit()) {
                 if (buf == null)
-                    buf = new StringBuffer();
+                    buf = new StringBuilder();
                 else
                     buf.append(", ");
                 buf.append(fmd);

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceUnitInfoImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceUnitInfoImpl.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceUnitInfoImpl.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceUnitInfoImpl.java Tue Jan 12 03:31:11 2010
@@ -398,7 +398,7 @@
         Properties metaFactoryProps = new Properties();
         if (info.getManagedClassNames() != null 
             && !info.getManagedClassNames().isEmpty()) {
-            StringBuffer types = new StringBuffer();
+            StringBuilder types = new StringBuilder();
             for (String type : info.getManagedClassNames()) {
                 if (types.length() > 0)
                     types.append(';');
@@ -409,7 +409,7 @@
         if (info.getJarFileUrls() != null && !info.getJarFileUrls().isEmpty()
             || (!info.excludeUnlistedClasses()
             && info.getPersistenceUnitRootUrl() != null)) {
-            StringBuffer jars = new StringBuffer();
+            StringBuilder jars = new StringBuilder();
             String file = null;
             if (!info.excludeUnlistedClasses()
                 && info.getPersistenceUnitRootUrl() != null) {
@@ -431,7 +431,7 @@
         }
         if (info.getMappingFileNames() != null
             && !info.getMappingFileNames().isEmpty()) {
-            StringBuffer rsrcs = new StringBuffer();
+            StringBuilder rsrcs = new StringBuilder();
             for (String rsrc : info.getMappingFileNames()) {
                 if (rsrcs.length() > 0)
                     rsrcs.append(';');

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/MetamodelImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/MetamodelImpl.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/MetamodelImpl.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/MetamodelImpl.java Tue Jan 12 03:31:11 2010
@@ -363,7 +363,7 @@
         }
         ParameterizedType pType = (ParameterizedType)type;
         java.lang.reflect.Type[] args = pType.getActualTypeArguments();
-        StringBuffer tmp = new StringBuffer(pType.getRawType().toString());
+        StringBuilder tmp = new StringBuilder(pType.getRawType().toString());
         for (int i = 0; i < args.length; i++) {
             tmp.append((i == 0) ? "<" : ",");
             tmp.append(toTypeName(args[i]));

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/SourceAnnotationHandler.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/SourceAnnotationHandler.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/SourceAnnotationHandler.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/SourceAnnotationHandler.java Tue Jan 12 03:31:11 2010
@@ -450,7 +450,7 @@
     
     String toDetails(Element e) {
         TypeMirror mirror = e.asType();
-        return new StringBuffer(e.getKind().toString()).append(" ")
+        return new StringBuilder(e.getKind().toString()).append(" ")
                            .append(e.toString())
                            .append("Mirror ")
                            .append(mirror.getKind().toString())

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/ArrayExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/ArrayExpression.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/ArrayExpression.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/ArrayExpression.java Tue Jan 12 03:31:11 2010
@@ -36,7 +36,7 @@
 
 	@Override
 	public String asExpression(AliasContext ctx) {
-		StringBuffer tmp = new StringBuffer(OPEN_BRACE);
+		StringBuilder tmp = new StringBuilder(OPEN_BRACE);
 		for (int i = 0; i < _values.length; i++) {
 			Object v = _values[i];
 			tmp.append((v instanceof Visitable ? 

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/JoinPath.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/JoinPath.java?rev=898168&r1=898167&r2=898168&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/JoinPath.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/JoinPath.java Tue Jan 12 03:31:11 2010
@@ -49,7 +49,7 @@
 		
 	@Override
 	public String asJoinable(AliasContext ctx) {
-		return new StringBuffer(getOperator().toString())
+		return new StringBuilder(getOperator().toString())
 		   .append(getParent().asProjection(ctx))
 		   .append(NAVIGATION)
 		   .append(getLastSegment())



Mime
View raw message