From 37dafa2a5ab6d40a83505fa0176762105b5601df Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Sun, 12 Feb 2012 00:58:22 +0000 Subject: [PATCH] Replace many StringBuffer occurrences with StringBuilder --- .../org/hibernate/PropertyValueException.java | 2 +- .../hibernate/cfg/CollectionSecondPass.java | 2 +- .../main/java/org/hibernate/cfg/HbmBinder.java | 2 +- .../hibernate/cfg/ImprovedNamingStrategy.java | 2 +- .../java/org/hibernate/criterion/Example.java | 6 +++--- .../criterion/IdentifierProjection.java | 2 +- .../java/org/hibernate/criterion/Order.java | 2 +- .../hibernate/criterion/ProjectionList.java | 4 ++-- .../criterion/PropertyProjection.java | 2 +- .../hibernate/criterion/SimpleExpression.java | 2 +- .../criterion/SubqueryExpression.java | 2 +- .../dialect/AbstractTransactSQLDialect.java | 2 +- .../org/hibernate/dialect/CUBRIDDialect.java | 2 +- .../org/hibernate/dialect/Cache71Dialect.java | 4 ++-- .../org/hibernate/dialect/DB2390Dialect.java | 2 +- .../org/hibernate/dialect/DB2400Dialect.java | 2 +- .../org/hibernate/dialect/DerbyDialect.java | 2 +- .../java/org/hibernate/dialect/H2Dialect.java | 2 +- .../org/hibernate/dialect/HSQLDialect.java | 4 ++-- .../org/hibernate/dialect/InformixDialect.java | 4 ++-- .../org/hibernate/dialect/Ingres9Dialect.java | 6 +++--- .../org/hibernate/dialect/IngresDialect.java | 2 +- .../org/hibernate/dialect/MySQLDialect.java | 4 ++-- .../org/hibernate/dialect/Oracle8iDialect.java | 2 +- .../org/hibernate/dialect/Oracle9Dialect.java | 2 +- .../org/hibernate/dialect/OracleDialect.java | 2 +- .../hibernate/dialect/RDMSOS2200Dialect.java | 2 +- .../org/hibernate/dialect/SAPDBDialect.java | 2 +- .../hibernate/dialect/SQLServerDialect.java | 2 +- .../org/hibernate/dialect/TimesTenDialect.java | 2 +- .../dialect/function/AnsiTrimFunction.java | 2 +- .../dialect/function/CharIndexFunction.java | 2 +- .../ConditionalParenthesisFunction.java | 2 +- .../dialect/function/DerbyConcatFunction.java | 2 +- .../function/PositionSubstringFunction.java | 2 +- .../StandardAnsiSqlAggregationFunctions.java | 2 +- .../dialect/function/TemplateRenderer.java | 4 ++-- .../dialect/function/VarArgsSQLFunction.java | 2 +- .../engine/internal/JoinSequence.java | 2 +- .../internal/StatefulPersistenceContext.java | 2 +- .../engine/jdbc/ResultSetWrapperProxy.java | 2 +- .../jdbc/internal/BasicFormatterImpl.java | 2 +- .../engine/jdbc/internal/DDLFormatterImpl.java | 6 +++--- .../engine/jdbc/spi/SqlExceptionHelper.java | 2 +- .../hibernate/engine/spi/QueryParameters.java | 2 +- .../hibernate/engine/spi/SubselectFetch.java | 2 +- .../internal/CollectionSubqueryFactory.java | 2 +- .../hibernate/hql/internal/NameGenerator.java | 2 +- .../hibernate/hql/internal/QuerySplitter.java | 4 ++-- .../hql/internal/ast/ErrorCounter.java | 2 +- .../internal/ast/tree/AbstractStatement.java | 2 +- .../hql/internal/ast/tree/ComponentJoin.java | 4 ++-- .../hql/internal/ast/tree/FromElementType.java | 4 ++-- .../internal/ast/tree/FromReferenceNode.java | 2 +- .../hql/internal/ast/tree/IdentNode.java | 2 +- .../hql/internal/ast/tree/IndexNode.java | 2 +- .../hql/internal/ast/tree/IntoClause.java | 2 +- .../hql/internal/ast/tree/ParameterNode.java | 2 +- .../ast/tree/ResultVariableRefNode.java | 2 +- .../hql/internal/ast/util/ASTPrinter.java | 6 +++--- .../hql/internal/ast/util/ASTUtil.java | 6 +++--- .../hql/internal/ast/util/JoinProcessor.java | 4 ++-- .../internal/classic/PathExpressionParser.java | 8 ++++---- .../internal/classic/PreprocessingParser.java | 4 ++-- .../internal/classic/QueryTranslatorImpl.java | 2 +- .../hql/internal/classic/WhereParser.java | 12 ++++++------ .../org/hibernate/id/IncrementGenerator.java | 2 +- .../id/MultipleHiLoPerTableGenerator.java | 2 +- .../java/org/hibernate/id/TableGenerator.java | 2 +- .../org/hibernate/id/UUIDHexGenerator.java | 6 +++--- .../hibernate/id/enhanced/TableGenerator.java | 2 +- .../hibernate/id/enhanced/TableStructure.java | 2 +- .../java/org/hibernate/id/uuid/Helper.java | 6 +++--- .../hibernate/internal/AbstractQueryImpl.java | 4 ++-- .../org/hibernate/internal/SessionImpl.java | 2 +- .../hibernate/internal/util/BytesHelper.java | 6 +++--- .../internal/util/collections/ArrayHelper.java | 2 +- .../util/config/ConfigurationHelper.java | 2 +- .../java/org/hibernate/loader/JoinWalker.java | 10 +++++----- .../collection/BasicCollectionJoinWalker.java | 2 +- .../collection/CollectionJoinWalker.java | 4 ++-- .../loader/collection/OneToManyJoinWalker.java | 2 +- .../criteria/CriteriaQueryTranslator.java | 4 ++-- .../loader/entity/CascadeEntityJoinWalker.java | 2 +- .../loader/entity/EntityJoinWalker.java | 4 ++-- .../java/org/hibernate/mapping/Constraint.java | 4 ++-- .../java/org/hibernate/mapping/ForeignKey.java | 6 +++--- .../main/java/org/hibernate/mapping/Index.java | 4 ++-- .../java/org/hibernate/mapping/PrimaryKey.java | 4 ++-- .../org/hibernate/mapping/SimpleValue.java | 2 +- .../main/java/org/hibernate/mapping/Table.java | 16 ++++++++-------- .../java/org/hibernate/mapping/UniqueKey.java | 4 ++-- .../relational/AbstractConstraint.java | 2 +- .../hibernate/metamodel/relational/Index.java | 2 +- .../metamodel/relational/PrimaryKey.java | 2 +- .../metamodel/relational/UniqueKey.java | 4 ++-- .../collection/OneToManyPersister.java | 2 +- .../entity/AbstractEntityPersister.java | 8 ++++---- .../entity/SingleTableEntityPersister.java | 2 +- .../org/hibernate/pretty/MessageHelper.java | 18 +++++++++--------- .../org/hibernate/sql/ANSICaseFragment.java | 2 +- .../org/hibernate/sql/ANSIJoinFragment.java | 6 +++--- .../org/hibernate/sql/ConditionFragment.java | 2 +- .../org/hibernate/sql/DecodeCaseFragment.java | 2 +- .../main/java/org/hibernate/sql/Delete.java | 2 +- .../org/hibernate/sql/DerbyCaseFragment.java | 2 +- .../org/hibernate/sql/DisjunctionFragment.java | 2 +- .../org/hibernate/sql/ForUpdateFragment.java | 2 +- .../org/hibernate/sql/HSQLCaseFragment.java | 4 ++-- .../main/java/org/hibernate/sql/Insert.java | 2 +- .../java/org/hibernate/sql/InsertSelect.java | 2 +- .../java/org/hibernate/sql/JoinFragment.java | 2 +- .../org/hibernate/sql/MckoiCaseFragment.java | 4 ++-- .../org/hibernate/sql/OracleJoinFragment.java | 10 +++++----- .../org/hibernate/sql/QueryJoinFragment.java | 8 ++++---- .../java/org/hibernate/sql/QuerySelect.java | 14 +++++++------- .../main/java/org/hibernate/sql/Select.java | 2 +- .../java/org/hibernate/sql/SelectFragment.java | 2 +- .../java/org/hibernate/sql/SimpleSelect.java | 4 ++-- .../hibernate/sql/Sybase11JoinFragment.java | 8 ++++---- .../main/java/org/hibernate/sql/Template.java | 4 ++-- .../main/java/org/hibernate/sql/Update.java | 2 +- .../stat/internal/SessionStatisticsImpl.java | 2 +- .../tuple/entity/AbstractEntityTuplizer.java | 2 +- .../org/hibernate/type/AbstractBynaryType.java | 2 +- .../hibernate/type/AbstractLongStringType.java | 6 +++--- .../java/org/hibernate/type/EntityType.java | 2 +- .../java/ByteArrayTypeDescriptor.java | 2 +- .../test/annotations/lob/TextTest.java | 2 +- .../test/any/ComplexPropertyValue.java | 2 +- .../hibernate/test/cascade/circle/Node.java | 2 +- .../hibernate/test/cascade/circle/Route.java | 2 +- .../test/cascade/circle/Transport.java | 2 +- .../hibernate/test/cascade/circle/Vehicle.java | 2 +- .../hibernate/test/lob/ClobLocatorTest.java | 2 +- .../org/hibernate/test/lob/LongStringTest.java | 2 +- .../sql/hand/custom/CustomSQLTestSupport.java | 2 +- .../sql/hand/query/NativeSQLQueriesTest.java | 2 +- 138 files changed, 230 insertions(+), 230 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/PropertyValueException.java b/hibernate-core/src/main/java/org/hibernate/PropertyValueException.java index 0e35b51fd5..241cd49063 100644 --- a/hibernate-core/src/main/java/org/hibernate/PropertyValueException.java +++ b/hibernate-core/src/main/java/org/hibernate/PropertyValueException.java @@ -69,7 +69,7 @@ public class PropertyValueException extends HibernateException { * @return parent-child path */ public static String buildPropertyPath(String parent, String child) { - return new StringBuffer(parent).append('.').append(child).toString(); + return new StringBuilder(parent).append('.').append(child).toString(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/CollectionSecondPass.java b/hibernate-core/src/main/java/org/hibernate/cfg/CollectionSecondPass.java index 36cc015132..89a6a676ee 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/CollectionSecondPass.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/CollectionSecondPass.java @@ -85,7 +85,7 @@ public abstract class CollectionSecondPass implements SecondPass { throws MappingException; private static String columns(Value val) { - StringBuffer columns = new StringBuffer(); + StringBuilder columns = new StringBuilder(); Iterator iter = val.getColumnIterator(); while ( iter.hasNext() ) { columns.append( ( (Selectable) iter.next() ).getText() ); diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/HbmBinder.java b/hibernate-core/src/main/java/org/hibernate/cfg/HbmBinder.java index e637f34aa5..29c147e6c4 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/HbmBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/HbmBinder.java @@ -1332,7 +1332,7 @@ public final class HbmBinder { } private static String columns(Value val) { - StringBuffer columns = new StringBuffer(); + StringBuilder columns = new StringBuilder(); Iterator iter = val.getColumnIterator(); while ( iter.hasNext() ) { columns.append( ( (Selectable) iter.next() ).getText() ); diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/ImprovedNamingStrategy.java b/hibernate-core/src/main/java/org/hibernate/cfg/ImprovedNamingStrategy.java index cbd09b2bdf..b9be3483c7 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/ImprovedNamingStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/ImprovedNamingStrategy.java @@ -69,7 +69,7 @@ public class ImprovedNamingStrategy implements NamingStrategy, Serializable { } protected static String addUnderscores(String name) { - StringBuffer buf = new StringBuffer( name.replace('.', '_') ); + StringBuilder buf = new StringBuilder( name.replace('.', '_') ); for (int i=1; i 1 ) { fragment.append( '(' ); } diff --git a/hibernate-core/src/main/java/org/hibernate/criterion/SubqueryExpression.java b/hibernate-core/src/main/java/org/hibernate/criterion/SubqueryExpression.java index c22d073c97..5a6615bf3c 100755 --- a/hibernate-core/src/main/java/org/hibernate/criterion/SubqueryExpression.java +++ b/hibernate-core/src/main/java/org/hibernate/criterion/SubqueryExpression.java @@ -80,7 +80,7 @@ public abstract class SubqueryExpression implements Criterion { String sql = walker.getSQLString(); - final StringBuffer buf = new StringBuffer( toLeftSqlString(criteria, criteriaQuery) ); + final StringBuilder buf = new StringBuilder( toLeftSqlString(criteria, criteriaQuery) ); if ( op != null ) { buf.append( ' ' ).append( op ).append( ' ' ); } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java index 24d880031b..59839f16b1 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java @@ -169,7 +169,7 @@ abstract class AbstractTransactSQLDialect extends Dialect { public String applyLocksToSql(String sql, LockOptions aliasedLockOptions, Map keyColumnNames) { // TODO: merge additional lockoptions support in Dialect.applyLocksToSql Iterator itr = aliasedLockOptions.getAliasLockIterator(); - StringBuffer buffer = new StringBuffer( sql ); + StringBuilder buffer = new StringBuilder( sql ); int correction = 0; while ( itr.hasNext() ) { final Map.Entry entry = ( Map.Entry ) itr.next(); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/CUBRIDDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/CUBRIDDialect.java index 0b4166b5e4..c9b4291dd1 100755 --- a/hibernate-core/src/main/java/org/hibernate/dialect/CUBRIDDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/CUBRIDDialect.java @@ -161,7 +161,7 @@ public class CUBRIDDialect extends Dialect { public String getLimitString(String sql, boolean hasOffset) { // CUBRID 8.3.0 support limit - return new StringBuffer( sql.length() + 20 ).append( sql ) + return new StringBuilder( sql.length() + 20 ).append( sql ) .append( hasOffset ? " limit ?, ?" : " limit ?" ).toString(); } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Cache71Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Cache71Dialect.java index e6be68ad22..702b721531 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Cache71Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Cache71Dialect.java @@ -418,7 +418,7 @@ public class Cache71Dialect extends Dialect { String[] primaryKey, boolean referencesPrimaryKey) { // The syntax used to add a foreign key constraint to a table. - return new StringBuffer( 300 ) + return new StringBuilder( 300 ) .append( " ADD CONSTRAINT " ) .append( constraintName ) .append( " FOREIGN KEY " ) @@ -622,7 +622,7 @@ public class Cache71Dialect extends Dialect { // but this extension is not supported through Hibernate anyway. int insertionPoint = sql.startsWith( "select distinct" ) ? 15 : 6; - return new StringBuffer( sql.length() + 8 ) + return new StringBuilder( sql.length() + 8 ) .append( sql ) .insert( insertionPoint, " TOP ? " ) .toString(); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB2390Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/DB2390Dialect.java index c0edbee36c..d4cfb0ff0b 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB2390Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DB2390Dialect.java @@ -63,7 +63,7 @@ public class DB2390Dialect extends DB2Dialect { if ( limit == 0 ) { return sql; } - return new StringBuffer( sql.length() + 40 ) + return new StringBuilder( sql.length() + 40 ) .append( sql ) .append( " fetch first " ) .append( limit ) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB2400Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/DB2400Dialect.java index 7bdd1ca229..67633c2c5c 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB2400Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DB2400Dialect.java @@ -63,7 +63,7 @@ public class DB2400Dialect extends DB2Dialect { if ( limit == 0 ) { return sql; } - return new StringBuffer( sql.length() + 40 ) + return new StringBuilder( sql.length() + 40 ) .append( sql ) .append( " fetch first " ) .append( limit ) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DerbyDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/DerbyDialect.java index 985dc6fd58..de7950843f 100755 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DerbyDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DerbyDialect.java @@ -178,7 +178,7 @@ public String getForUpdateString() { */ @Override public String getLimitString(String query, final int offset, final int limit) { - StringBuffer sb = new StringBuffer(query.length() + 50); + StringBuilder sb = new StringBuilder(query.length() + 50); final String normalizedSelect = query.toLowerCase().trim(); final int forUpdateIndex = normalizedSelect.lastIndexOf( "for update") ; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java index 7d233f5b40..cdc503dd14 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java @@ -221,7 +221,7 @@ public class H2Dialect extends Dialect { } public String getLimitString(String sql, boolean hasOffset) { - return new StringBuffer( sql.length() + 20 ) + return new StringBuilder( sql.length() + 20 ) .append( sql ) .append( hasOffset ? " limit ? offset ?" : " limit ?" ) .toString(); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/HSQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/HSQLDialect.java index bef64fe643..42338ef7a1 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/HSQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/HSQLDialect.java @@ -257,7 +257,7 @@ public class HSQLDialect extends Dialect { public String getLimitString(String sql, boolean hasOffset) { if ( hsqldbVersion < 20 ) { - return new StringBuffer( sql.length() + 10 ) + return new StringBuilder( sql.length() + 10 ) .append( sql ) .insert( sql.toLowerCase().indexOf( "select" ) + 6, @@ -266,7 +266,7 @@ public class HSQLDialect extends Dialect { .toString(); } else { - return new StringBuffer( sql.length() + 20 ) + return new StringBuilder( sql.length() + 20 ) .append( sql ) .append( hasOffset ? " offset ? limit ?" : " limit ?" ) .toString(); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/InformixDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/InformixDialect.java index cf060c869f..4c6057354f 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/InformixDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/InformixDialect.java @@ -110,7 +110,7 @@ public class InformixDialect extends Dialect { String referencedTable, String[] primaryKey, boolean referencesPrimaryKey) { - StringBuffer result = new StringBuffer( 30 ) + StringBuilder result = new StringBuilder( 30 ) .append( " add constraint " ) .append( " foreign key (" ) .append( StringHelper.join( ", ", foreignKey ) ) @@ -180,7 +180,7 @@ public class InformixDialect extends Dialect { if ( offset > 0 ) { throw new UnsupportedOperationException( "query result offset is not supported" ); } - return new StringBuffer( querySelect.length() + 8 ) + return new StringBuilder( querySelect.length() + 8 ) .append( querySelect ) .insert( querySelect.toLowerCase().indexOf( "select" ) + 6, " first " + limit ) .toString(); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Ingres9Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Ingres9Dialect.java index 888ccb6c88..a9de59008a 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Ingres9Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Ingres9Dialect.java @@ -237,9 +237,9 @@ public class Ingres9Dialect extends IngresDialect { * @return the modified SQL */ public String getLimitString(String querySelect, int offset, int limit) { - StringBuffer soff = new StringBuffer(" offset " + offset); - StringBuffer slim = new StringBuffer(" fetch first " + limit + " rows only"); - StringBuffer sb = new StringBuffer(querySelect.length() + + StringBuilder soff = new StringBuilder(" offset " + offset); + StringBuilder slim = new StringBuilder(" fetch first " + limit + " rows only"); + StringBuilder sb = new StringBuilder(querySelect.length() + soff.length() + slim.length()).append(querySelect); if (offset > 0) { sb.append(soff); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/IngresDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/IngresDialect.java index 4df76fe272..a7dbaf194c 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/IngresDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/IngresDialect.java @@ -288,7 +288,7 @@ public class IngresDialect extends Dialect { if ( offset > 0 ) { throw new UnsupportedOperationException( "query result offset is not supported" ); } - return new StringBuffer( querySelect.length() + 16 ) + return new StringBuilder( querySelect.length() + 16 ) .append( querySelect ) .insert( 6, " first " + limit ) .toString(); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java index 98c05b323f..d013005a6c 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java @@ -211,7 +211,7 @@ public class MySQLDialect extends Dialect { String[] primaryKey, boolean referencesPrimaryKey ) { String cols = StringHelper.join(", ", foreignKey); - return new StringBuffer(30) + return new StringBuilder(30) .append(" add index ") .append(constraintName) .append(" (") @@ -237,7 +237,7 @@ public class MySQLDialect extends Dialect { } public String getLimitString(String sql, boolean hasOffset) { - return new StringBuffer( sql.length() + 20 ) + return new StringBuilder( sql.length() + 20 ) .append( sql ) .append( hasOffset ? " limit ?, ?" : " limit ?" ) .toString(); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle8iDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Oracle8iDialect.java index 9ab1d110c3..62d99a1761 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle8iDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Oracle8iDialect.java @@ -245,7 +245,7 @@ public class Oracle8iDialect extends Dialect { isForUpdate = true; } - StringBuffer pagingSelect = new StringBuffer( sql.length()+100 ); + StringBuilder pagingSelect = new StringBuilder( sql.length()+100 ); if (hasOffset) { pagingSelect.append("select * from ( select row_.*, rownum rownum_ from ( "); } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle9Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Oracle9Dialect.java index d7bb327362..b502e9c8e8 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle9Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Oracle9Dialect.java @@ -219,7 +219,7 @@ public class Oracle9Dialect extends Dialect { isForUpdate = true; } - StringBuffer pagingSelect = new StringBuffer( sql.length()+100 ); + StringBuilder pagingSelect = new StringBuilder( sql.length()+100 ); if (hasOffset) { pagingSelect.append("select * from ( select row_.*, rownum rownum_ from ( "); } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java index e2b7437f47..a34dab7190 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java @@ -72,7 +72,7 @@ public class OracleDialect extends Oracle9Dialect { isForUpdate = true; } - StringBuffer pagingSelect = new StringBuffer( sql.length()+100 ); + StringBuilder pagingSelect = new StringBuilder( sql.length()+100 ); if (hasOffset) { pagingSelect.append("select * from ( select row_.*, rownum rownum_ from ( "); } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/RDMSOS2200Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/RDMSOS2200Dialect.java index 5a1adaf071..6d45c1c6d5 100755 --- a/hibernate-core/src/main/java/org/hibernate/dialect/RDMSOS2200Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/RDMSOS2200Dialect.java @@ -321,7 +321,7 @@ public class RDMSOS2200Dialect extends Dialect { if ( offset > 0 ) { throw new UnsupportedOperationException( "query result offset is not supported" ); } - return new StringBuffer( sql.length() + 40 ) + return new StringBuilder( sql.length() + 40 ) .append( sql ) .append( " fetch first " ) .append( limit ) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SAPDBDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/SAPDBDialect.java index d697cfe24e..5cf6eda7db 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SAPDBDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SAPDBDialect.java @@ -151,7 +151,7 @@ public class SAPDBDialect extends Dialect { String referencedTable, String[] primaryKey, boolean referencesPrimaryKey ) { - StringBuffer res = new StringBuffer(30) + StringBuilder res = new StringBuilder(30) .append(" foreign key ") .append(constraintName) .append(" (") diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerDialect.java index 98ae87757a..6b969d526e 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerDialect.java @@ -75,7 +75,7 @@ public class SQLServerDialect extends AbstractTransactSQLDialect { if ( offset > 0 ) { throw new UnsupportedOperationException( "query result offset is not supported" ); } - return new StringBuffer( querySelect.length() + 8 ) + return new StringBuilder( querySelect.length() + 8 ) .append( querySelect ) .insert( getAfterSelectInsertPoint( querySelect ), " top " + limit ) .toString(); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/TimesTenDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/TimesTenDialect.java index 108c1be4da..b2f611aeb2 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/TimesTenDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/TimesTenDialect.java @@ -184,7 +184,7 @@ public class TimesTenDialect extends Dialect { if ( offset > 0 ) { throw new UnsupportedOperationException( "query result offset is not supported" ); } - return new StringBuffer( querySelect.length() + 8 ) + return new StringBuilder( querySelect.length() + 8 ) .append( querySelect ) .insert( 6, " first " + limit ) .toString(); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/AnsiTrimFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/AnsiTrimFunction.java index fa10faa06b..e8427b8bf1 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/AnsiTrimFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/AnsiTrimFunction.java @@ -31,7 +31,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor; */ public class AnsiTrimFunction extends TrimFunctionTemplate { protected String render(Options options, String trimSource, SessionFactoryImplementor factory) { - return new StringBuffer() + return new StringBuilder() .append( "trim(" ) .append( options.getTrimSpecification().getName() ) .append( ' ' ) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/CharIndexFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/CharIndexFunction.java index ef6458d795..5b29a650a3 100755 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/CharIndexFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/CharIndexFunction.java @@ -53,7 +53,7 @@ public class CharIndexFunction implements SQLFunction { Object string = args.get(1); Object start = threeArgs ? args.get(2) : null; - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("charindex(").append( pattern ).append(", "); if (threeArgs) buf.append( "right("); buf.append( string ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/ConditionalParenthesisFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/ConditionalParenthesisFunction.java index 8dbf5bf6b4..4f35062f40 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/ConditionalParenthesisFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/ConditionalParenthesisFunction.java @@ -49,7 +49,7 @@ public class ConditionalParenthesisFunction extends StandardSQLFunction { public String render(List args, SessionFactoryImplementor factory) { final boolean hasArgs = !args.isEmpty(); - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append( getName() ); if ( hasArgs ) { buf.append( "(" ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/DerbyConcatFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/DerbyConcatFunction.java index a080f6677b..786933fdcb 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/DerbyConcatFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/DerbyConcatFunction.java @@ -165,7 +165,7 @@ public class DerbyConcatFunction implements SQLFunction { private static String join(Iterator/**/ elements, StringTransformer elementTransformer, StringJoinTemplate template) { // todo : make this available via StringHelper? - StringBuffer buffer = new StringBuffer( template.getBeginning() ); + StringBuilder buffer = new StringBuilder( template.getBeginning() ); while ( elements.hasNext() ) { final String element = ( String ) elements.next(); buffer.append( elementTransformer.transform( element ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/PositionSubstringFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/PositionSubstringFunction.java index 6604393117..0e188bb71a 100755 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/PositionSubstringFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/PositionSubstringFunction.java @@ -53,7 +53,7 @@ public class PositionSubstringFunction implements SQLFunction { Object string = args.get(1); Object start = threeArgs ? args.get(2) : null; - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (threeArgs) buf.append('('); buf.append("position(").append( pattern ).append(" in "); if (threeArgs) buf.append( "substring("); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/StandardAnsiSqlAggregationFunctions.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/StandardAnsiSqlAggregationFunctions.java index b1a996fd52..34712c321f 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/StandardAnsiSqlAggregationFunctions.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/StandardAnsiSqlAggregationFunctions.java @@ -62,7 +62,7 @@ public class StandardAnsiSqlAggregationFunctions { } private String renderCountDistinct(List arguments) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append( "count(distinct " ); String sep = ""; Iterator itr = arguments.iterator(); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/TemplateRenderer.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/TemplateRenderer.java index bb01f8eb34..68247fa9e3 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/TemplateRenderer.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/TemplateRenderer.java @@ -49,8 +49,8 @@ public class TemplateRenderer { List chunkList = new ArrayList(); List paramList = new ArrayList(); - StringBuffer chunk = new StringBuffer( 10 ); - StringBuffer index = new StringBuffer( 2 ); + StringBuilder chunk = new StringBuilder( 10 ); + StringBuilder index = new StringBuilder( 2 ); for ( int i = 0; i < template.length(); ++i ) { char c = template.charAt( i ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/VarArgsSQLFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/VarArgsSQLFunction.java index dac1e13c59..3b894e9d0f 100755 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/VarArgsSQLFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/VarArgsSQLFunction.java @@ -99,7 +99,7 @@ public class VarArgsSQLFunction implements SQLFunction { } public String render(Type firstArgumentType, List arguments, SessionFactoryImplementor factory) { - StringBuffer buf = new StringBuffer().append( begin ); + StringBuilder buf = new StringBuilder().append( begin ); for ( int i = 0; i < arguments.size(); i++ ) { buf.append( transformArgument( ( String ) arguments.get( i ) ) ); if ( i < arguments.size() - 1 ) { diff --git a/hibernate-core/src/main/java/org/hibernate/engine/internal/JoinSequence.java b/hibernate-core/src/main/java/org/hibernate/engine/internal/JoinSequence.java index 469d8da1ac..241db74ce4 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/internal/JoinSequence.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/internal/JoinSequence.java @@ -46,7 +46,7 @@ public class JoinSequence { private final SessionFactoryImplementor factory; private final List joins = new ArrayList(); private boolean useThetaStyle = false; - private final StringBuffer conditions = new StringBuffer(); + private final StringBuilder conditions = new StringBuilder(); private String rootAlias; private Joinable rootJoinable; private Selector selector; diff --git a/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java b/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java index f7dd1dcfe2..c6ae439f14 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java @@ -1134,7 +1134,7 @@ public class StatefulPersistenceContext implements PersistenceContext { */ @Override public String toString() { - return new StringBuffer() + return new StringBuilder() .append("PersistenceContext[entityKeys=") .append(entitiesByKey.keySet()) .append(",collectionKeys=") diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/ResultSetWrapperProxy.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/ResultSetWrapperProxy.java index 700afc188d..e2cb8773a2 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/ResultSetWrapperProxy.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/ResultSetWrapperProxy.java @@ -100,7 +100,7 @@ public class ResultSetWrapperProxy implements InvocationHandler { ); } catch ( SQLException ex ) { - StringBuffer buf = new StringBuffer() + StringBuilder buf = new StringBuilder() .append( "Exception getting column index for column: [" ) .append( args[0] ) .append( "].\nReverting to using: [" ) diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/BasicFormatterImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/BasicFormatterImpl.java index c07b62f5fc..38e07eb0f6 100755 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/BasicFormatterImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/BasicFormatterImpl.java @@ -106,7 +106,7 @@ public class BasicFormatterImpl implements Formatter { int indent = 1; - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); StringTokenizer tokens; String lastToken; String token; diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/DDLFormatterImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/DDLFormatterImpl.java index b951c5287a..21ce4f7803 100755 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/DDLFormatterImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/DDLFormatterImpl.java @@ -61,7 +61,7 @@ public class DDLFormatterImpl implements Formatter { } private String formatCommentOn(String sql) { - StringBuffer result = new StringBuffer( 60 ).append( "\n " ); + StringBuilder result = new StringBuilder( 60 ).append( "\n " ); StringTokenizer tokens = new StringTokenizer( sql, " '[]\"", true ); boolean quoted = false; @@ -82,7 +82,7 @@ public class DDLFormatterImpl implements Formatter { } private String formatAlterTable(String sql) { - StringBuffer result = new StringBuffer( 60 ).append( "\n " ); + StringBuilder result = new StringBuilder( 60 ).append( "\n " ); StringTokenizer tokens = new StringTokenizer( sql, " (,)'[]\"", true ); boolean quoted = false; @@ -103,7 +103,7 @@ public class DDLFormatterImpl implements Formatter { } private String formatCreateTable(String sql) { - StringBuffer result = new StringBuffer( 60 ).append( "\n " ); + StringBuilder result = new StringBuilder( 60 ).append( "\n " ); StringTokenizer tokens = new StringTokenizer( sql, "(,)'[]\"", true ); int depth = 0; diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/SqlExceptionHelper.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/SqlExceptionHelper.java index 1f8a7228c2..0581f82b1d 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/SqlExceptionHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/SqlExceptionHelper.java @@ -182,7 +182,7 @@ public class SqlExceptionHelper { */ public static abstract class WarningHandlerLoggingSupport implements WarningHandler { public final void handleWarning( SQLWarning warning ) { - StringBuffer buf = new StringBuffer(30).append("SQL Warning Code: ").append(warning.getErrorCode()).append(", SQLState: ").append(warning.getSQLState()); + StringBuilder buf = new StringBuilder(30).append("SQL Warning Code: ").append(warning.getErrorCode()).append(", SQLState: ").append(warning.getSQLState()); logWarning(buf.toString(), warning.getMessage()); } diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/QueryParameters.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/QueryParameters.java index a320e7eafb..94ecdda162 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/QueryParameters.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/QueryParameters.java @@ -472,7 +472,7 @@ public final class QueryParameters { } else { final Dialect dialect = factory.getDialect(); - String symbols = new StringBuffer().append( ParserHelper.HQL_SEPARATORS ) + String symbols = new StringBuilder().append( ParserHelper.HQL_SEPARATORS ) .append( dialect.openQuote() ) .append( dialect.closeQuote() ) .toString(); diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/SubselectFetch.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/SubselectFetch.java index 9694b91ca1..400176a7b0 100755 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/SubselectFetch.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/SubselectFetch.java @@ -82,7 +82,7 @@ public class SubselectFetch { StringHelper.qualify( alias, loadable.getIdentifierColumnNames() ) : ( (PropertyMapping) loadable ).toColumns(alias, ukname); - return new StringBuffer() + return new StringBuilder() .append("select ") .append( StringHelper.join(", ", joinColumns) ) .append(queryString) diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/CollectionSubqueryFactory.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/CollectionSubqueryFactory.java index e6839c18f8..8fb8a1951c 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/CollectionSubqueryFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/CollectionSubqueryFactory.java @@ -52,7 +52,7 @@ public final class CollectionSubqueryFactory { String[] columns) { try { JoinFragment join = joinSequence.toJoinFragment( enabledFilters, true ); - return new StringBuffer( "select " ) + return new StringBuilder( "select " ) .append( StringHelper.join( ", ", columns ) ) .append( " from " ) .append( join.toFromFragmentString().substring( 2 ) )// remove initial ", " diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/NameGenerator.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/NameGenerator.java index 532ea2caa2..434f432fdf 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/NameGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/NameGenerator.java @@ -52,7 +52,7 @@ public final class NameGenerator { } public static String scalarName(int x, int y) { - return new StringBuffer() + return new StringBuilder() .append( "col_" ) .append( x ) .append( '_' ) diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/QuerySplitter.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/QuerySplitter.java index 6ca5170a46..0c8665feff 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/QuerySplitter.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/QuerySplitter.java @@ -85,7 +85,7 @@ public final class QuerySplitter { if ( tokens.length == 0 ) return new String[]{query}; // just especially for the trivial collection filter ArrayList placeholders = new ArrayList(); ArrayList replacements = new ArrayList(); - StringBuffer templateQuery = new StringBuffer( 40 ); + StringBuilder templateQuery = new StringBuilder( 40 ); int start = getStartingPositionFor(tokens, templateQuery); int count = 0; @@ -137,7 +137,7 @@ public final class QuerySplitter { return tokens[tokens.length - 1]; } - private static int getStartingPositionFor(String[] tokens, StringBuffer templateQuery) { + private static int getStartingPositionFor(String[] tokens, StringBuilder templateQuery) { templateQuery.append( tokens[0] ); if ( !"select".equals( tokens[0].toLowerCase() ) ) return 1; diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/ErrorCounter.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/ErrorCounter.java index b2a88395f6..bee855397e 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/ErrorCounter.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/ErrorCounter.java @@ -65,7 +65,7 @@ public class ErrorCounter implements ParseErrorHandler { } private String getErrorString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); for ( Iterator iterator = errorList.iterator(); iterator.hasNext(); ) { buf.append( ( String ) iterator.next() ); if ( iterator.hasNext() ) buf.append( "\n" ); diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/AbstractStatement.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/AbstractStatement.java index abadefe6da..3d9531ca60 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/AbstractStatement.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/AbstractStatement.java @@ -38,7 +38,7 @@ public abstract class AbstractStatement extends HqlSqlWalkerNode implements Disp * @return String - The additional display text. */ public String getDisplayText() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if ( getWalker().getQuerySpaces().size() > 0 ) { buf.append( " querySpaces (" ); for ( Iterator iterator = getWalker().getQuerySpaces().iterator(); iterator.hasNext(); ) { diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/ComponentJoin.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/ComponentJoin.java index a639507c79..ea2aa8b375 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/ComponentJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/ComponentJoin.java @@ -57,7 +57,7 @@ public class ComponentJoin extends FromElement { initializeComponentJoin( new ComponentFromElementType( this ) ); final String[] cols = origin.getPropertyMapping( "" ).toColumns( getTableAlias(), componentProperty ); - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); for ( int j = 0; j < cols.length; j++ ) { final String column = cols[j]; if ( j > 0 ) { @@ -147,7 +147,7 @@ public class ComponentJoin extends FromElement { @Override public String renderScalarIdentifierSelect(int i) { String[] cols = getBasePropertyMapping().toColumns( getTableAlias(), getComponentProperty() ); - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); // For property references generate . as for ( int j = 0; j < cols.length; j++ ) { final String column = cols[j]; diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/FromElementType.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/FromElementType.java index 647e1f4ca3..0a2c5a9068 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/FromElementType.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/FromElementType.java @@ -139,7 +139,7 @@ class FromElementType { String renderScalarIdentifierSelect(int i) { checkInitialized(); String[] cols = getPropertyMapping( EntityPersister.ENTITY_ID ).toColumns( getTableAlias(), EntityPersister.ENTITY_ID ); - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); // For property references generate . as for ( int j = 0; j < cols.length; j++ ) { String column = cols[j]; @@ -165,7 +165,7 @@ class FromElementType { // TODO: Replace this with a more elegant solution. String[] idColumnNames = ( persister != null ) ? ( ( Queryable ) persister ).getIdentifierColumnNames() : new String[0]; - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); for ( int i = 0; i < idColumnNames.length; i++ ) { buf.append( fromElement.getTableAlias() ).append( '.' ).append( idColumnNames[i] ); if ( i != idColumnNames.length - 1 ) buf.append( ", " ); diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/FromReferenceNode.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/FromReferenceNode.java index 42c189f735..8f1cdc663f 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/FromReferenceNode.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/FromReferenceNode.java @@ -76,7 +76,7 @@ public abstract class FromReferenceNode extends AbstractSelectExpression } public String getDisplayText() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append( "{" ).append( ( fromElement == null ) ? "no fromElement" : fromElement.getDisplayText() ); buf.append( "}" ); return buf.toString(); diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/IdentNode.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/IdentNode.java index 24b9c39380..72519d4d91 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/IdentNode.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/IdentNode.java @@ -318,7 +318,7 @@ public class IdentNode extends FromReferenceNode implements SelectExpression { @Override public String getDisplayText() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (getType() == SqlTokenTypes.ALIAS_REF) { buf.append("{alias=").append(getOriginalText()); diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/IndexNode.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/IndexNode.java index f3f9c287ea..c579b9b6d5 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/IndexNode.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/IndexNode.java @@ -205,7 +205,7 @@ public class IndexNode extends FromReferenceNode { } private String collectDisplayInfo() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); Iterator itr = paramSpecs.iterator(); while ( itr.hasNext() ) { buffer.append( ( ( ParameterSpecification ) itr.next() ).renderDisplayInfo() ); diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/IntoClause.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/IntoClause.java index b73a14d226..2e3855e94e 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/IntoClause.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/IntoClause.java @@ -138,7 +138,7 @@ public class IntoClause extends HqlSqlWalkerNode implements DisplayableNode { * @return String - The additional display text. */ public String getDisplayText() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append( "IntoClause{" ); buf.append( "entityName=" ).append( getEntityName() ); buf.append( ",tableName=" ).append( getTableName() ); diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/ParameterNode.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/ParameterNode.java index d18cd03de0..03260b7797 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/ParameterNode.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/ParameterNode.java @@ -59,7 +59,7 @@ public class ParameterNode extends HqlSqlWalkerNode implements DisplayableNode, public String getRenderText(SessionFactoryImplementor sessionFactory) { int count = 0; if ( getExpectedType() != null && ( count = getExpectedType().getColumnSpan( sessionFactory ) ) > 1 ) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append( "(?" ); for ( int i = 1; i < count; i++ ) { buffer.append( ", ?" ); diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/ResultVariableRefNode.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/ResultVariableRefNode.java index 0e517eccdc..4580cc57fe 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/ResultVariableRefNode.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/ResultVariableRefNode.java @@ -77,7 +77,7 @@ public class ResultVariableRefNode extends HqlSqlWalkerNode { private String getColumnPositionsString(int scalarColumnIndex ) { int startPosition = getWalker().getSelectClause().getColumnNamesStartPosition( scalarColumnIndex ); - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); int nColumns = getWalker().getSelectClause().getColumnNames()[ scalarColumnIndex ].length; for ( int i = startPosition; i < startPosition + nColumns; i++ ) { if ( i > startPosition ) { diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/ASTPrinter.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/ASTPrinter.java index a6bee93ef7..ca11a0ecba 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/ASTPrinter.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/ASTPrinter.java @@ -187,7 +187,7 @@ public class ASTPrinter { if ( ast == null ) { return "{node:null}"; } - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append( "[" ).append( getTokenTypeName( ast.getType() ) ).append( "] " ); if ( showClassName ) { buf.append( StringHelper.unqualify( ast.getClass().getName() ) ).append( ": " ); @@ -208,7 +208,7 @@ public class ASTPrinter { return buf.toString(); } - public static void appendEscapedMultibyteChars(String text, StringBuffer buf) { + public static void appendEscapedMultibyteChars(String text, StringBuilder buf) { char[] chars = text.toCharArray(); for (int i = 0; i < chars.length; i++) { char aChar = chars[i]; @@ -222,7 +222,7 @@ public class ASTPrinter { } public static String escapeMultibyteChars(String text) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); appendEscapedMultibyteChars(text,buf); return buf.toString(); } diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/ASTUtil.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/ASTUtil.java index 00e5d1cdb1..c0bfc3a261 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/ASTUtil.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/ASTUtil.java @@ -220,7 +220,7 @@ public final class ASTUtil { * @return The list representation of the tree. */ public static String getDebugString(AST n) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append( "[ " ); buf.append( ( n == null ) ? "{null}" : n.toStringTree() ); buf.append( " ]" ); @@ -267,12 +267,12 @@ public final class ASTUtil { } public static String getPathText(AST n) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); getPathText( buf, n ); return buf.toString(); } - private static void getPathText(StringBuffer buf, AST n) { + private static void getPathText(StringBuilder buf, AST n) { AST firstChild = n.getFirstChild(); // If the node has a first child, recurse into the first child. if ( firstChild != null ) { diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/JoinProcessor.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/JoinProcessor.java index 5fc74cea14..5e45e92dea 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/JoinProcessor.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/JoinProcessor.java @@ -209,12 +209,12 @@ public class JoinProcessor implements SqlTokenTypes { } Dialect dialect = walker.getSessionFactoryHelper().getFactory().getDialect(); - String symbols = new StringBuffer().append( ParserHelper.HQL_SEPARATORS ) + String symbols = new StringBuilder().append( ParserHelper.HQL_SEPARATORS ) .append( dialect.openQuote() ) .append( dialect.closeQuote() ) .toString(); StringTokenizer tokens = new StringTokenizer( sqlFragment, symbols, true ); - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); while ( tokens.hasMoreTokens() ) { final String token = tokens.nextToken(); diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/PathExpressionParser.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/PathExpressionParser.java index ee0ccca479..7f9dd413bf 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/PathExpressionParser.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/PathExpressionParser.java @@ -65,9 +65,9 @@ public class PathExpressionParser implements Parser { private String collectionName; private String collectionOwnerName; private String collectionRole; - private final StringBuffer componentPath = new StringBuffer(); + private final StringBuilder componentPath = new StringBuilder(); private Type type; - private final StringBuffer path = new StringBuffer(); + private final StringBuilder path = new StringBuilder(); private boolean ignoreInitialJoin; private boolean continuation; private JoinType joinType = JoinType.INNER_JOIN; //default mode @@ -261,7 +261,7 @@ public class PathExpressionParser implements Parser { } else { if ( componentPath.length() > 0 ) { - return new StringBuffer() + return new StringBuilder() .append( currentProperty ) .append( '.' ) .append( componentPath.toString() ) @@ -384,7 +384,7 @@ public class PathExpressionParser implements Parser { String alias; String[] elementColumns; JoinSequence joinSequence; - StringBuffer indexValue = new StringBuffer(); + StringBuilder indexValue = new StringBuilder(); } public CollectionElement lastCollectionElement() { diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/PreprocessingParser.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/PreprocessingParser.java index c2347e25cf..9a73da7f1f 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/PreprocessingParser.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/PreprocessingParser.java @@ -60,7 +60,7 @@ public class PreprocessingParser implements Parser { private Map replacements; private boolean quoted; - private StringBuffer quotedString; + private StringBuilder quotedString; private ClauseParser parser = new ClauseParser(); private String lastToken; private String currentCollectionProp; @@ -80,7 +80,7 @@ public class PreprocessingParser implements Parser { token = quotedString.toString(); } else { - quotedString = new StringBuffer( 20 ).append( token ); + quotedString = new StringBuilder( 20 ).append( token ); } quoted = !quoted; } diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/QueryTranslatorImpl.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/QueryTranslatorImpl.java index 54f330edae..9b6f7e27ef 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/QueryTranslatorImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/QueryTranslatorImpl.java @@ -712,7 +712,7 @@ public class QueryTranslatorImpl extends BasicLoader implements FilterTranslator boolean isSubselect = superQuery != null; - StringBuffer buf = new StringBuffer( 20 ); + StringBuilder buf = new StringBuilder( 20 ); if ( scalarTypes.size() == 0 ) { //ie. no select clause diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/WhereParser.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/WhereParser.java index 7e02533396..1aae46493c 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/WhereParser.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/WhereParser.java @@ -178,7 +178,7 @@ public class WhereParser implements Parser { private boolean inSubselect = false; private int bracketsSinceSelect = 0; - private StringBuffer subselect; + private StringBuilder subselect; private boolean expectingPathContinuation = false; private int expectingIndex = 0; @@ -233,7 +233,7 @@ public class WhereParser implements Parser { //Cope with a subselect if ( !inSubselect && ( lcToken.equals( "select" ) || lcToken.equals( "from" ) ) ) { inSubselect = true; - subselect = new StringBuffer( 20 ); + subselect = new StringBuilder( 20 ); } if ( inSubselect && token.equals( ")" ) ) { bracketsSinceSelect--; @@ -323,8 +323,8 @@ public class WhereParser implements Parser { } else { - StringBuffer join = ( StringBuffer ) joins.removeLast(); - ( ( StringBuffer ) joins.getLast() ).append( join.toString() ); + StringBuilder join = ( StringBuilder ) joins.removeLast(); + ( ( StringBuilder ) joins.getLast() ).append( join.toString() ); } if ( nots.removeLast() ) negated = !negated; @@ -335,7 +335,7 @@ public class WhereParser implements Parser { private void openExpression(QueryTranslatorImpl q, String lcToken) { nots.addLast( Boolean.FALSE ); booleanTests.addLast( Boolean.FALSE ); - joins.addLast( new StringBuffer() ); + joins.addLast( new StringBuilder() ); if ( !"(".equals( lcToken ) ) appendToken( q, "(" ); } @@ -454,7 +454,7 @@ public class WhereParser implements Parser { } private void addToCurrentJoin(String sql) { - ( ( StringBuffer ) joins.getLast() ).append( sql ); + ( ( StringBuilder ) joins.getLast() ).append( sql ); } private void addToCurrentJoin(PathExpressionParser.CollectionElement ce) diff --git a/hibernate-core/src/main/java/org/hibernate/id/IncrementGenerator.java b/hibernate-core/src/main/java/org/hibernate/id/IncrementGenerator.java index 044dec1dec..728d8364af 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/IncrementGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/id/IncrementGenerator.java @@ -99,7 +99,7 @@ public class IncrementGenerator implements IdentifierGenerator, Configurable { ) ); - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); for ( int i=0; i < tables.length; i++ ) { final String tableName = dialect.quote( normalizer.normalizeIdentifierQuoting( tables[i] ) ); if ( tables.length > 1 ) { diff --git a/hibernate-core/src/main/java/org/hibernate/id/MultipleHiLoPerTableGenerator.java b/hibernate-core/src/main/java/org/hibernate/id/MultipleHiLoPerTableGenerator.java index 6d26ef0a77..6457cd6a5e 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/MultipleHiLoPerTableGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/id/MultipleHiLoPerTableGenerator.java @@ -134,7 +134,7 @@ public class MultipleHiLoPerTableGenerator implements PersistentIdentifierGenera } public String[] sqlDropStrings(Dialect dialect) throws HibernateException { - StringBuffer sqlDropString = new StringBuffer( "drop table " ); + StringBuilder sqlDropString = new StringBuilder( "drop table " ); if ( dialect.supportsIfExistsBeforeTableName() ) { sqlDropString.append( "if exists " ); } diff --git a/hibernate-core/src/main/java/org/hibernate/id/TableGenerator.java b/hibernate-core/src/main/java/org/hibernate/id/TableGenerator.java index 2519164267..06469597a2 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/TableGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/id/TableGenerator.java @@ -207,7 +207,7 @@ public class TableGenerator implements PersistentIdentifierGenerator, Configurab } public String[] sqlDropStrings(Dialect dialect) { - StringBuffer sqlDropString = new StringBuffer( "drop table " ); + StringBuilder sqlDropString = new StringBuilder( "drop table " ); if ( dialect.supportsIfExistsBeforeTableName() ) { sqlDropString.append( "if exists " ); } diff --git a/hibernate-core/src/main/java/org/hibernate/id/UUIDHexGenerator.java b/hibernate-core/src/main/java/org/hibernate/id/UUIDHexGenerator.java index b0fd1f7f76..b4b12bb4a7 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/UUIDHexGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/id/UUIDHexGenerator.java @@ -71,7 +71,7 @@ public class UUIDHexGenerator extends AbstractUUIDGenerator implements Configura * {@inheritDoc} */ public Serializable generate(SessionImplementor session, Object obj) { - return new StringBuffer( 36 ) + return new StringBuilder( 36 ) .append( format( getIP() ) ).append( sep ) .append( format( getJVM() ) ).append( sep ) .append( format( getHiTime() ) ).append( sep ) @@ -82,14 +82,14 @@ public class UUIDHexGenerator extends AbstractUUIDGenerator implements Configura protected String format(int intValue) { String formatted = Integer.toHexString( intValue ); - StringBuffer buf = new StringBuffer( "00000000" ); + StringBuilder buf = new StringBuilder( "00000000" ); buf.replace( 8 - formatted.length(), 8, formatted ); return buf.toString(); } protected String format(short shortValue) { String formatted = Integer.toHexString( shortValue ); - StringBuffer buf = new StringBuffer( "0000" ); + StringBuilder buf = new StringBuilder( "0000" ); buf.replace( 4 - formatted.length(), 4, formatted ); return buf.toString(); } diff --git a/hibernate-core/src/main/java/org/hibernate/id/enhanced/TableGenerator.java b/hibernate-core/src/main/java/org/hibernate/id/enhanced/TableGenerator.java index fce1612668..565f2bf446 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/enhanced/TableGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/id/enhanced/TableGenerator.java @@ -549,7 +549,7 @@ public class TableGenerator implements PersistentIdentifierGenerator, Configurab @Override public String[] sqlCreateStrings(Dialect dialect) throws HibernateException { return new String[] { - new StringBuffer() + new StringBuilder() .append( dialect.getCreateTableString() ) .append( ' ' ) .append( tableName ) diff --git a/hibernate-core/src/main/java/org/hibernate/id/enhanced/TableStructure.java b/hibernate-core/src/main/java/org/hibernate/id/enhanced/TableStructure.java index fbbbfd2666..b86f723d8f 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/enhanced/TableStructure.java +++ b/hibernate-core/src/main/java/org/hibernate/id/enhanced/TableStructure.java @@ -187,7 +187,7 @@ public class TableStructure implements DatabaseStructure { @Override public String[] sqlDropStrings(Dialect dialect) throws HibernateException { - StringBuffer sqlDropString = new StringBuffer().append( "drop table " ); + StringBuilder sqlDropString = new StringBuilder().append( "drop table " ); if ( dialect.supportsIfExistsBeforeTableName() ) { sqlDropString.append( "if exists " ); } diff --git a/hibernate-core/src/main/java/org/hibernate/id/uuid/Helper.java b/hibernate-core/src/main/java/org/hibernate/id/uuid/Helper.java index a19fa6d4c6..4e6e6b2cd7 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/uuid/Helper.java +++ b/hibernate-core/src/main/java/org/hibernate/id/uuid/Helper.java @@ -118,14 +118,14 @@ public class Helper { public static String format(int value) { final String formatted = Integer.toHexString( value ); - StringBuffer buf = new StringBuffer( "00000000".intern() ); + StringBuilder buf = new StringBuilder( "00000000" ); buf.replace( 8 - formatted.length(), 8, formatted ); return buf.toString(); } public static String format(short value) { String formatted = Integer.toHexString( value ); - StringBuffer buf = new StringBuffer( "0000" ); + StringBuilder buf = new StringBuilder( "0000" ); buf.replace( 4 - formatted.length(), 4, formatted ); return buf.toString(); } @@ -139,7 +139,7 @@ public class Helper { System.out.println( "ip address int : " + addressInt ); String formatted = Integer.toHexString( addressInt ); - StringBuffer buf = new StringBuffer( "00000000" ); + StringBuilder buf = new StringBuilder( "00000000" ); buf.replace( 8 - formatted.length(), 8, formatted ); String addressHex = buf.toString(); System.out.println( "ip address hex : " + addressHex ); diff --git a/hibernate-core/src/main/java/org/hibernate/internal/AbstractQueryImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/AbstractQueryImpl.java index 4d40eefc6d..cbb121a62d 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/AbstractQueryImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/AbstractQueryImpl.java @@ -754,7 +754,7 @@ public abstract class AbstractQueryImpl implements Query { boolean isJpaPositionalParam = parameterMetadata.getNamedParameterDescriptor( name ).isJpaStyle(); String paramPrefix = isJpaPositionalParam ? "?" : ParserHelper.HQL_VARIABLE_PREFIX; String placeholder = - new StringBuffer( paramPrefix.length() + name.length() ) + new StringBuilder( paramPrefix.length() + name.length() ) .append( paramPrefix ).append( name ) .toString(); @@ -783,7 +783,7 @@ public abstract class AbstractQueryImpl implements Query { return query; } - StringBuffer list = new StringBuffer( 16 ); + StringBuilder list = new StringBuilder( 16 ); Iterator iter = vals.iterator(); int i = 0; while ( iter.hasNext() ) { diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java index 29e5ec2d3a..671f1d0ee0 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java @@ -1782,7 +1782,7 @@ public final class SessionImpl extends AbstractSessionImpl implements EventSourc } public String toString() { - StringBuffer buf = new StringBuffer(500) + StringBuilder buf = new StringBuilder(500) .append( "SessionImpl(" ); if ( !isClosed() ) { buf.append(persistenceContext) diff --git a/hibernate-core/src/main/java/org/hibernate/internal/util/BytesHelper.java b/hibernate-core/src/main/java/org/hibernate/internal/util/BytesHelper.java index 9968a6de9d..392c9e64f3 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/util/BytesHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/util/BytesHelper.java @@ -122,21 +122,21 @@ public final class BytesHelper { if ( formatted.length() > 8 ) { formatted = formatted.substring( formatted.length() - 8 ); } - StringBuffer buf = new StringBuffer( "00000000" ); + StringBuilder buf = new StringBuilder( "00000000" ); buf.replace( 8 - formatted.length(), 8, formatted ); return buf.toString(); } public static String toBinaryString(int value) { String formatted = Long.toBinaryString( value ); - StringBuffer buf = new StringBuffer( StringHelper.repeat( '0', 32 ) ); + StringBuilder buf = new StringBuilder( StringHelper.repeat( '0', 32 ) ); buf.replace( 64 - formatted.length(), 64, formatted ); return buf.toString(); } public static String toBinaryString(long value) { String formatted = Long.toBinaryString( value ); - StringBuffer buf = new StringBuffer( StringHelper.repeat( '0', 64 ) ); + StringBuilder buf = new StringBuilder( StringHelper.repeat( '0', 64 ) ); buf.replace( 64 - formatted.length(), 64, formatted ); return buf.toString(); } diff --git a/hibernate-core/src/main/java/org/hibernate/internal/util/collections/ArrayHelper.java b/hibernate-core/src/main/java/org/hibernate/internal/util/collections/ArrayHelper.java index 657f791d00..bb86007ad0 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/util/collections/ArrayHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/util/collections/ArrayHelper.java @@ -201,7 +201,7 @@ public final class ArrayHelper { private ArrayHelper() {} public static String toString( Object[] array ) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("["); for (int i = 0; i < array.length; i++) { sb.append( array[i] ); diff --git a/hibernate-core/src/main/java/org/hibernate/internal/util/config/ConfigurationHelper.java b/hibernate-core/src/main/java/org/hibernate/internal/util/config/ConfigurationHelper.java index 598d962232..924961c17e 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/util/config/ConfigurationHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/util/config/ConfigurationHelper.java @@ -334,7 +334,7 @@ public final class ConfigurationHelper { if ( property.indexOf( PLACEHOLDER_START ) < 0 ) { return property; } - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); char[] chars = property.toCharArray(); for ( int pos = 0; pos < chars.length; pos++ ) { if ( chars[pos] == '$' ) { diff --git a/hibernate-core/src/main/java/org/hibernate/loader/JoinWalker.java b/hibernate-core/src/main/java/org/hibernate/loader/JoinWalker.java index e7cd0e2b11..b14b98ef04 100755 --- a/hibernate-core/src/main/java/org/hibernate/loader/JoinWalker.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/JoinWalker.java @@ -898,7 +898,7 @@ public class JoinWalker { */ protected static final String orderBy(List associations) throws MappingException { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); Iterator iter = associations.iterator(); OuterJoinableAssociation last = null; while ( iter.hasNext() ) { @@ -934,13 +934,13 @@ public class JoinWalker { /** * Render the where condition for a (batch) load by identifier / collection key */ - protected StringBuffer whereString(String alias, String[] columnNames, int batchSize) { + protected StringBuilder whereString(String alias, String[] columnNames, int batchSize) { if ( columnNames.length==1 ) { // if not a composite key, use "foo in (?, ?, ?)" for batching // if no batch, and not a composite key, use "foo = ?" InFragment in = new InFragment().setColumn( alias, columnNames[0] ); for ( int i=0; i1) buf.append('('); buf.append( StringHelper.join(", ", StringHelper.qualify(alias, columnNames) ) ); if (columnNames.length>1) buf.append(')'); diff --git a/hibernate-core/src/main/java/org/hibernate/loader/collection/OneToManyJoinWalker.java b/hibernate-core/src/main/java/org/hibernate/loader/collection/OneToManyJoinWalker.java index 44ebaeeb3a..89203000a5 100755 --- a/hibernate-core/src/main/java/org/hibernate/loader/collection/OneToManyJoinWalker.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/collection/OneToManyJoinWalker.java @@ -97,7 +97,7 @@ public class OneToManyJoinWalker extends CollectionJoinWalker { final int collectionJoins = countCollectionPersisters( associations ) + 1; collectionSuffixes = BasicLoader.generateSuffixes( joins + 1, collectionJoins ); - StringBuffer whereString = whereString( + StringBuilder whereString = whereString( alias, oneToManyPersister.getKeyColumnNames(), subquery, diff --git a/hibernate-core/src/main/java/org/hibernate/loader/criteria/CriteriaQueryTranslator.java b/hibernate-core/src/main/java/org/hibernate/loader/criteria/CriteriaQueryTranslator.java index dbfaf78588..200b71d0b2 100755 --- a/hibernate-core/src/main/java/org/hibernate/loader/criteria/CriteriaQueryTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/criteria/CriteriaQueryTranslator.java @@ -412,7 +412,7 @@ public class CriteriaQueryTranslator implements CriteriaQuery { } public String getWhereCondition() { - StringBuffer condition = new StringBuffer( 30 ); + StringBuilder condition = new StringBuilder( 30 ); Iterator criterionIterator = rootCriteria.iterateExpressionEntries(); while ( criterionIterator.hasNext() ) { CriteriaImpl.CriterionEntry entry = ( CriteriaImpl.CriterionEntry ) criterionIterator.next(); @@ -426,7 +426,7 @@ public class CriteriaQueryTranslator implements CriteriaQuery { } public String getOrderBy() { - StringBuffer orderBy = new StringBuffer( 30 ); + StringBuilder orderBy = new StringBuilder( 30 ); Iterator criterionIterator = rootCriteria.iterateOrderings(); while ( criterionIterator.hasNext() ) { CriteriaImpl.OrderEntry oe = ( CriteriaImpl.OrderEntry ) criterionIterator.next(); diff --git a/hibernate-core/src/main/java/org/hibernate/loader/entity/CascadeEntityJoinWalker.java b/hibernate-core/src/main/java/org/hibernate/loader/entity/CascadeEntityJoinWalker.java index ff40c01e34..a958e67ac0 100755 --- a/hibernate-core/src/main/java/org/hibernate/loader/entity/CascadeEntityJoinWalker.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/entity/CascadeEntityJoinWalker.java @@ -43,7 +43,7 @@ public class CascadeEntityJoinWalker extends AbstractEntityJoinWalker { throws MappingException { super( persister, factory, LoadQueryInfluencers.NONE ); this.cascadeAction = action; - StringBuffer whereCondition = whereString( getAlias(), persister.getIdentifierColumnNames(), 1 ) + StringBuilder whereCondition = whereString( getAlias(), persister.getIdentifierColumnNames(), 1 ) //include the discriminator and class-level where, but not filters .append( persister.filterFragment( getAlias(), CollectionHelper.EMPTY_MAP ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/loader/entity/EntityJoinWalker.java b/hibernate-core/src/main/java/org/hibernate/loader/entity/EntityJoinWalker.java index 577e4e9206..e7fa8b5f7a 100755 --- a/hibernate-core/src/main/java/org/hibernate/loader/entity/EntityJoinWalker.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/entity/EntityJoinWalker.java @@ -67,7 +67,7 @@ public class EntityJoinWalker extends AbstractEntityJoinWalker { this.lockOptions.setLockMode(lockMode); - StringBuffer whereCondition = whereString( getAlias(), uniqueKey, batchSize ) + StringBuilder whereCondition = whereString( getAlias(), uniqueKey, batchSize ) //include the discriminator and class-level where, but not filters .append( persister.filterFragment( getAlias(), Collections.EMPTY_MAP ) ); @@ -86,7 +86,7 @@ public class EntityJoinWalker extends AbstractEntityJoinWalker { super( persister, factory, loadQueryInfluencers ); LockOptions.copy(lockOptions, this.lockOptions); - StringBuffer whereCondition = whereString( getAlias(), uniqueKey, batchSize ) + StringBuilder whereCondition = whereString( getAlias(), uniqueKey, batchSize ) //include the discriminator and class-level where, but not filters .append( persister.filterFragment( getAlias(), Collections.EMPTY_MAP ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/Constraint.java b/hibernate-core/src/main/java/org/hibernate/mapping/Constraint.java index 7ecfd31863..9fff9398e7 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/Constraint.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/Constraint.java @@ -98,7 +98,7 @@ public abstract class Constraint implements RelationalModel, Serializable { public String sqlDropString(Dialect dialect, String defaultCatalog, String defaultSchema) { if ( isGenerated( dialect ) ) { - return new StringBuffer() + return new StringBuilder() .append( "alter table " ) .append( getTable().getQualifiedName( dialect, defaultCatalog, defaultSchema ) ) .append( " drop constraint " ) @@ -113,7 +113,7 @@ public abstract class Constraint implements RelationalModel, Serializable { public String sqlCreateString(Dialect dialect, Mapping p, String defaultCatalog, String defaultSchema) { if ( isGenerated( dialect ) ) { String constraintString = sqlConstraintString( dialect, getName(), defaultCatalog, defaultSchema ); - StringBuffer buf = new StringBuffer( "alter table " ) + StringBuilder buf = new StringBuilder( "alter table " ) .append( getTable().getQualifiedName( dialect, defaultCatalog, defaultSchema ) ) .append( constraintString ); return buf.toString(); diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/ForeignKey.java b/hibernate-core/src/main/java/org/hibernate/mapping/ForeignKey.java index 3859f87068..4e63dd012b 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/ForeignKey.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/ForeignKey.java @@ -70,7 +70,7 @@ public class ForeignKey extends Constraint { return referencedTable; } - private void appendColumns(StringBuffer buf, Iterator columns) { + private void appendColumns(StringBuilder buf, Iterator columns) { while( columns.hasNext() ) { Column column = (Column) columns.next(); buf.append( column.getName() ); @@ -95,7 +95,7 @@ public class ForeignKey extends Constraint { private void alignColumns(Table referencedTable) { if ( referencedTable.getPrimaryKey().getColumnSpan()!=getColumnSpan() ) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("Foreign key (") .append( getName() + ":") .append( getTable().getName() ) @@ -170,7 +170,7 @@ public class ForeignKey extends Constraint { public String toString() { if(!isReferenceToPrimaryKey() ) { - StringBuffer result = new StringBuffer(getClass().getName() + '(' + getTable().getName() + getColumns() ); + StringBuilder result = new StringBuilder(getClass().getName() + '(' + getTable().getName() + getColumns() ); result.append( " ref-columns:" + '(' + getReferencedColumns() ); result.append( ") as " + getName() ); return result.toString(); diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/Index.java b/hibernate-core/src/main/java/org/hibernate/mapping/Index.java index 786c2d85ad..f91fc55694 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/Index.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/Index.java @@ -80,7 +80,7 @@ public class Index implements RelationalModel, Serializable { String defaultSchema ) { //TODO handle supportsNotNullUnique=false, but such a case does not exist in the wild so far - StringBuffer buf = new StringBuffer( "create" ) + StringBuilder buf = new StringBuilder( "create" ) .append( unique ? " unique" : "" ) @@ -103,7 +103,7 @@ public class Index implements RelationalModel, Serializable { // Used only in Table for sqlCreateString (but commented out at the moment) public String sqlConstraintString(Dialect dialect) { - StringBuffer buf = new StringBuffer( " index (" ); + StringBuilder buf = new StringBuilder( " index (" ); Iterator iter = getColumnIterator(); while ( iter.hasNext() ) { buf.append( ( (Column) iter.next() ).getQuotedName( dialect ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/PrimaryKey.java b/hibernate-core/src/main/java/org/hibernate/mapping/PrimaryKey.java index 29800db3db..7df07997ba 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/PrimaryKey.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/PrimaryKey.java @@ -33,7 +33,7 @@ import org.hibernate.dialect.Dialect; public class PrimaryKey extends Constraint { public String sqlConstraintString(Dialect dialect) { - StringBuffer buf = new StringBuffer("primary key ("); + StringBuilder buf = new StringBuilder("primary key ("); Iterator iter = getColumnIterator(); while ( iter.hasNext() ) { buf.append( ( (Column) iter.next() ).getQuotedName(dialect) ); @@ -43,7 +43,7 @@ public class PrimaryKey extends Constraint { } public String sqlConstraintString(Dialect dialect, String constraintName, String defaultCatalog, String defaultSchema) { - StringBuffer buf = new StringBuffer( + StringBuilder buf = new StringBuilder( dialect.getAddPrimaryKeyConstraintString(constraintName) ).append('('); Iterator iter = getColumnIterator(); diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/SimpleValue.java b/hibernate-core/src/main/java/org/hibernate/mapping/SimpleValue.java index 91529f7ad8..cae52f0be5 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/SimpleValue.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/SimpleValue.java @@ -164,7 +164,7 @@ public class SimpleValue implements KeyValue { params.setProperty( PersistentIdentifierGenerator.PK, columnName ); if (rootClass!=null) { - StringBuffer tables = new StringBuffer(); + StringBuilder tables = new StringBuilder(); Iterator iter = rootClass.getIdentityTables().iterator(); while ( iter.hasNext() ) { Table table= (Table) iter.next(); diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/Table.java b/hibernate-core/src/main/java/org/hibernate/mapping/Table.java index 26f288ce83..8d643060f8 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/Table.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/Table.java @@ -122,7 +122,7 @@ public class Table implements RelationalModel, Serializable { } public static String qualify(String catalog, String schema, String table) { - StringBuffer qualifiedName = new StringBuffer(); + StringBuilder qualifiedName = new StringBuilder(); if ( catalog != null ) { qualifiedName.append( catalog ).append( '.' ); } @@ -296,7 +296,7 @@ public class Table implements RelationalModel, Serializable { String defaultSchema) throws HibernateException { - StringBuffer root = new StringBuffer( "alter table " ) + StringBuilder root = new StringBuilder( "alter table " ) .append( getQualifiedName( dialect, defaultCatalog, defaultSchema ) ) .append( ' ' ) .append( dialect.getAddColumnString() ); @@ -310,7 +310,7 @@ public class Table implements RelationalModel, Serializable { if ( columnInfo == null ) { // the column doesnt exist at all. - StringBuffer alter = new StringBuffer( root.toString() ) + StringBuilder alter = new StringBuilder( root.toString() ) .append( ' ' ) .append( column.getQuotedName( dialect ) ) .append( ' ' ) @@ -359,7 +359,7 @@ public class Table implements RelationalModel, Serializable { } public String sqlTemporaryTableCreateString(Dialect dialect, Mapping mapping) throws HibernateException { - StringBuffer buffer = new StringBuffer( dialect.getCreateTemporaryTableString() ) + StringBuilder buffer = new StringBuilder( dialect.getCreateTemporaryTableString() ) .append( ' ' ) .append( name ) .append( " (" ); @@ -498,7 +498,7 @@ public class Table implements RelationalModel, Serializable { } public String sqlDropString(Dialect dialect, String defaultCatalog, String defaultSchema) { - StringBuffer buf = new StringBuffer( "drop table " ); + StringBuilder buf = new StringBuilder( "drop table " ); if ( dialect.supportsIfExistsBeforeTableName() ) { buf.append( "if exists " ); } @@ -695,7 +695,7 @@ public class Table implements RelationalModel, Serializable { } public String toString() { - StringBuffer buf = new StringBuffer().append( getClass().getName() ) + StringBuilder buf = new StringBuilder().append( getClass().getName() ) .append( '(' ); if ( getCatalog() != null ) { buf.append( getCatalog() + "." ); @@ -760,7 +760,7 @@ public class Table implements RelationalModel, Serializable { if ( dialect.supportsCommentOn() ) { String tableName = getQualifiedName( dialect, defaultCatalog, defaultSchema ); if ( comment != null ) { - StringBuffer buf = new StringBuffer() + StringBuilder buf = new StringBuilder() .append( "comment on table " ) .append( tableName ) .append( " is '" ) @@ -773,7 +773,7 @@ public class Table implements RelationalModel, Serializable { Column column = (Column) iter.next(); String columnComment = column.getComment(); if ( columnComment != null ) { - StringBuffer buf = new StringBuffer() + StringBuilder buf = new StringBuilder() .append( "comment on column " ) .append( tableName ) .append( '.' ) diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/UniqueKey.java b/hibernate-core/src/main/java/org/hibernate/mapping/UniqueKey.java index aeaba72757..f703f88a4c 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/UniqueKey.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/UniqueKey.java @@ -35,7 +35,7 @@ import org.hibernate.engine.spi.Mapping; public class UniqueKey extends Constraint { public String sqlConstraintString(Dialect dialect) { - StringBuffer buf = new StringBuffer( "unique (" ); + StringBuilder buf = new StringBuilder( "unique (" ); boolean hadNullableColumn = false; Iterator iter = getColumnIterator(); while ( iter.hasNext() ) { @@ -60,7 +60,7 @@ public class UniqueKey extends Constraint { String constraintName, String defaultCatalog, String defaultSchema) { - StringBuffer buf = new StringBuffer( + StringBuilder buf = new StringBuilder( dialect.getAddUniqueConstraintString( constraintName ) ).append( '(' ); Iterator iter = getColumnIterator(); diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/relational/AbstractConstraint.java b/hibernate-core/src/main/java/org/hibernate/metamodel/relational/AbstractConstraint.java index 7cb9ab74fa..bad9ae1c74 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/relational/AbstractConstraint.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/relational/AbstractConstraint.java @@ -96,7 +96,7 @@ public abstract class AbstractConstraint implements Constraint { } else { return new String[] { - new StringBuffer() + new StringBuilder() .append( "alter table " ) .append( getTable().getQualifiedName( dialect ) ) .append( " drop constraint " ) diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/relational/Index.java b/hibernate-core/src/main/java/org/hibernate/metamodel/relational/Index.java index 8a164c0f82..20b4356ebc 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/relational/Index.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/relational/Index.java @@ -106,7 +106,7 @@ public class Index extends AbstractConstraint implements Constraint { public String[] sqlDropStrings(Dialect dialect) { return new String[] { - new StringBuffer( "drop index " ) + new StringBuilder( "drop index " ) .append( StringHelper.qualify( getTable().getQualifiedName( dialect ), diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/relational/PrimaryKey.java b/hibernate-core/src/main/java/org/hibernate/metamodel/relational/PrimaryKey.java index 5546f5a22a..3962571ef4 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/relational/PrimaryKey.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/relational/PrimaryKey.java @@ -77,7 +77,7 @@ public class PrimaryKey extends AbstractConstraint implements Constraint, Export } public String sqlConstraintStringInAlterTable(Dialect dialect) { - StringBuffer buf = new StringBuffer( + StringBuilder buf = new StringBuilder( dialect.getAddPrimaryKeyConstraintString( getName() ) ).append('('); boolean first = true; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/relational/UniqueKey.java b/hibernate-core/src/main/java/org/hibernate/metamodel/relational/UniqueKey.java index 68a2629fb8..4fbffeba1e 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/relational/UniqueKey.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/relational/UniqueKey.java @@ -61,7 +61,7 @@ public class UniqueKey extends AbstractConstraint implements Constraint { } public String sqlConstraintStringInCreateTable(Dialect dialect) { - StringBuffer buf = new StringBuffer( "unique (" ); + StringBuilder buf = new StringBuilder( "unique (" ); boolean hadNullableColumn = false; boolean first = true; for ( Column column : getColumns() ) { @@ -84,7 +84,7 @@ public class UniqueKey extends AbstractConstraint implements Constraint { @Override public String sqlConstraintStringInAlterTable(Dialect dialect) { - StringBuffer buf = new StringBuffer( + StringBuilder buf = new StringBuilder( dialect.getAddUniqueConstraintString( getName() ) ).append( '(' ); boolean nullable = false; diff --git a/hibernate-core/src/main/java/org/hibernate/persister/collection/OneToManyPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/collection/OneToManyPersister.java index e646b6071a..8d3e53798c 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/collection/OneToManyPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/collection/OneToManyPersister.java @@ -339,7 +339,7 @@ public class OneToManyPersister extends AbstractCollectionPersister { String entitySuffix, String collectionSuffix, boolean includeCollectionColumns) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if ( includeCollectionColumns ) { // buf.append( selectFragment( lhsAlias, "" ) )//ignore suffix for collection columns! buf.append( selectFragment( lhsAlias, collectionSuffix ) ) diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java index 72f238b693..bf94e118fa 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java @@ -1548,7 +1548,7 @@ public abstract class AbstractEntityPersister String fromClause = fromTableFragment( getRootAlias() ) + fromJoinFragment( getRootAlias(), true, false ); - String whereClause = new StringBuffer() + String whereClause = new StringBuilder() .append( StringHelper.join( "=? and ", aliasedIdColumns ) ) .append( "=?" ) .append( whereJoinFragment( getRootAlias(), true, false ) ) @@ -1629,7 +1629,7 @@ public abstract class AbstractEntityPersister String fromClause = fromTableFragment( getRootAlias() ) + fromJoinFragment( getRootAlias(), true, false ); - String whereClause = new StringBuffer() + String whereClause = new StringBuilder() .append( StringHelper.join( "=? and ", aliasedIdColumns ) ) .append( "=?" ) @@ -1891,7 +1891,7 @@ public abstract class AbstractEntityPersister if ( tableNumber == 0 ) { return rootAlias; } - StringBuffer buf = new StringBuffer().append( rootAlias ); + StringBuilder buf = new StringBuilder().append( rootAlias ); if ( !rootAlias.endsWith( "_" ) ) { buf.append( '_' ); } @@ -4460,7 +4460,7 @@ public abstract class AbstractEntityPersister select.setFromClause( fromTableFragment( getRootAlias() ) + fromJoinFragment( getRootAlias(), true, false ) ); String[] aliasedIdColumns = StringHelper.qualify( getRootAlias(), getIdentifierColumnNames() ); - String whereClause = new StringBuffer() + String whereClause = new StringBuilder() .append( StringHelper.join( "=? and ", aliasedIdColumns ) ) .append( "=?" ) diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/SingleTableEntityPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/SingleTableEntityPersister.java index 3a4d252fb7..2d8a959472 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/SingleTableEntityPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/SingleTableEntityPersister.java @@ -852,7 +852,7 @@ public class SingleTableEntityPersister extends AbstractEntityPersister { if ( !queryable.isAbstract() ) frag.addValue( queryable.getDiscriminatorSQLValue() ); } - StringBuffer buf = new StringBuffer(50) + StringBuilder buf = new StringBuilder(50) .append(" and ") .append( frag.toFragmentString() ); diff --git a/hibernate-core/src/main/java/org/hibernate/pretty/MessageHelper.java b/hibernate-core/src/main/java/org/hibernate/pretty/MessageHelper.java index 98f25a433f..7da348880d 100644 --- a/hibernate-core/src/main/java/org/hibernate/pretty/MessageHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/pretty/MessageHelper.java @@ -54,7 +54,7 @@ public final class MessageHelper { * @return An info string, in the form [FooBar#1]. */ public static String infoString(String entityName, Serializable id) { - StringBuffer s = new StringBuffer(); + StringBuilder s = new StringBuilder(); s.append( '[' ); if( entityName == null ) { s.append( "" ); @@ -87,7 +87,7 @@ public final class MessageHelper { EntityPersister persister, Object id, SessionFactoryImplementor factory) { - StringBuffer s = new StringBuffer(); + StringBuilder s = new StringBuilder(); s.append( '[' ); Type idType; if( persister == null ) { @@ -131,7 +131,7 @@ public final class MessageHelper { Object id, Type identifierType, SessionFactoryImplementor factory) { - StringBuffer s = new StringBuffer(); + StringBuilder s = new StringBuilder(); s.append( '[' ); if( persister == null ) { s.append( "" ); @@ -164,7 +164,7 @@ public final class MessageHelper { EntityPersister persister, Serializable[] ids, SessionFactoryImplementor factory) { - StringBuffer s = new StringBuffer(); + StringBuilder s = new StringBuilder(); s.append( '[' ); if( persister == null ) { s.append( "" ); @@ -193,7 +193,7 @@ public final class MessageHelper { * @return An info string, in the form [FooBar] */ public static String infoString(EntityPersister persister) { - StringBuffer s = new StringBuffer(); + StringBuilder s = new StringBuilder(); s.append( '[' ); if ( persister == null ) { s.append( "" ); @@ -215,7 +215,7 @@ public final class MessageHelper { * @return An info string, in the form [Foo.bars#1] */ public static String infoString(String entityName, String propertyName, Object key) { - StringBuffer s = new StringBuffer() + StringBuilder s = new StringBuilder() .append( '[' ) .append( entityName ) .append( '.' ) @@ -249,7 +249,7 @@ public final class MessageHelper { CollectionPersister persister, Serializable[] ids, SessionFactoryImplementor factory) { - StringBuffer s = new StringBuffer(); + StringBuilder s = new StringBuilder(); s.append( '[' ); if ( persister == null ) { s.append( "" ); @@ -286,7 +286,7 @@ public final class MessageHelper { CollectionPersister persister, Serializable id, SessionFactoryImplementor factory) { - StringBuffer s = new StringBuffer(); + StringBuilder s = new StringBuilder(); s.append( '[' ); if ( persister == null ) { s.append( "" ); @@ -320,7 +320,7 @@ public final class MessageHelper { * @return An info string, in the form [Foo.bars#1] */ public static String collectionInfoString(String role, Serializable id) { - StringBuffer s = new StringBuffer(); + StringBuilder s = new StringBuilder(); s.append( '[' ); if( role == null ) { s.append( "" ); diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ANSICaseFragment.java b/hibernate-core/src/main/java/org/hibernate/sql/ANSICaseFragment.java index 8652363a88..c76a8beca2 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ANSICaseFragment.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ANSICaseFragment.java @@ -37,7 +37,7 @@ public class ANSICaseFragment extends CaseFragment { public String toFragmentString() { - StringBuffer buf = new StringBuffer( cases.size() * 15 + 10 ) + StringBuilder buf = new StringBuilder( cases.size() * 15 + 10 ) .append("case"); Iterator iter = cases.entrySet().iterator(); diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ANSIJoinFragment.java b/hibernate-core/src/main/java/org/hibernate/sql/ANSIJoinFragment.java index 167e4c8c05..905f73a964 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ANSIJoinFragment.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ANSIJoinFragment.java @@ -32,8 +32,8 @@ import org.hibernate.AssertionFailure; */ public class ANSIJoinFragment extends JoinFragment { - private StringBuffer buffer = new StringBuffer(); - private StringBuffer conditions = new StringBuffer(); + private StringBuilder buffer = new StringBuilder(); + private StringBuilder conditions = new StringBuilder(); public void addJoin(String tableName, String alias, String[] fkColumns, String[] pkColumns, JoinType joinType) { addJoin(tableName, alias, fkColumns, pkColumns, joinType, null); @@ -96,7 +96,7 @@ public class ANSIJoinFragment extends JoinFragment { public JoinFragment copy() { ANSIJoinFragment copy = new ANSIJoinFragment(); - copy.buffer = new StringBuffer( buffer.toString() ); + copy.buffer = new StringBuilder( buffer.toString() ); return copy; } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ConditionFragment.java b/hibernate-core/src/main/java/org/hibernate/sql/ConditionFragment.java index 26344b55e9..79355660bc 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ConditionFragment.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ConditionFragment.java @@ -66,7 +66,7 @@ public class ConditionFragment { } public String toFragmentString() { - StringBuffer buf = new StringBuffer( lhs.length * 10 ); + StringBuilder buf = new StringBuilder( lhs.length * 10 ); for ( int i=0; i0 ) buffer.append(" or "); diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ForUpdateFragment.java b/hibernate-core/src/main/java/org/hibernate/sql/ForUpdateFragment.java index efec45e785..375199aac9 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ForUpdateFragment.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ForUpdateFragment.java @@ -37,7 +37,7 @@ import org.hibernate.internal.util.StringHelper; * @author Gavin King */ public class ForUpdateFragment { - private final StringBuffer aliases = new StringBuffer(); + private final StringBuilder aliases = new StringBuilder(); private boolean isNowaitEnabled; private final Dialect dialect; private LockMode lockMode; diff --git a/hibernate-core/src/main/java/org/hibernate/sql/HSQLCaseFragment.java b/hibernate-core/src/main/java/org/hibernate/sql/HSQLCaseFragment.java index 9927eb8c31..4e4b4c53d8 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/HSQLCaseFragment.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/HSQLCaseFragment.java @@ -36,8 +36,8 @@ import java.util.Map; public class HSQLCaseFragment extends CaseFragment { public String toFragmentString() { - StringBuffer buf = new StringBuffer( cases.size() * 15 + 10 ); - StringBuffer buf2 = new StringBuffer( cases.size() ); + StringBuilder buf = new StringBuilder( cases.size() * 15 + 10 ); + StringBuilder buf2 = new StringBuilder( cases.size() ); Iterator iter = cases.entrySet().iterator(); while ( iter.hasNext() ) { diff --git a/hibernate-core/src/main/java/org/hibernate/sql/Insert.java b/hibernate-core/src/main/java/org/hibernate/sql/Insert.java index fe4411aa28..90788e25af 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/Insert.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/Insert.java @@ -106,7 +106,7 @@ public class Insert { } public String toStatementString() { - StringBuffer buf = new StringBuffer( columns.size()*15 + tableName.length() + 10 ); + StringBuilder buf = new StringBuilder( columns.size()*15 + tableName.length() + 10 ); if ( comment != null ) { buf.append( "/* " ).append( comment ).append( " */ " ); } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/InsertSelect.java b/hibernate-core/src/main/java/org/hibernate/sql/InsertSelect.java index ad50da0413..37bda6996b 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/InsertSelect.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/InsertSelect.java @@ -78,7 +78,7 @@ public class InsertSelect { if ( tableName == null ) throw new HibernateException( "no table name defined for insert-select" ); if ( select == null ) throw new HibernateException( "no select defined for insert-select" ); - StringBuffer buf = new StringBuffer( (columnNames.size() * 15) + tableName.length() + 10 ); + StringBuilder buf = new StringBuilder( (columnNames.size() * 15) + tableName.length() + 10 ); if ( comment!=null ) { buf.append( "/* " ).append( comment ).append( " */ " ); } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/JoinFragment.java b/hibernate-core/src/main/java/org/hibernate/sql/JoinFragment.java index b71c264df2..d5e1d8cd1c 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/JoinFragment.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/JoinFragment.java @@ -91,7 +91,7 @@ public abstract class JoinFragment { * @param on The 'on' condition. * @return Returns true if the condition was added, false if the condition was already in 'on' string. */ - protected boolean addCondition(StringBuffer buffer, String on) { + protected boolean addCondition(StringBuilder buffer, String on) { if ( StringHelper.isNotEmpty( on ) ) { if ( !on.startsWith( " and" ) ) buffer.append( " and " ); buffer.append( on ); diff --git a/hibernate-core/src/main/java/org/hibernate/sql/MckoiCaseFragment.java b/hibernate-core/src/main/java/org/hibernate/sql/MckoiCaseFragment.java index eb17937289..2df1a05fec 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/MckoiCaseFragment.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/MckoiCaseFragment.java @@ -36,8 +36,8 @@ import java.util.Map; public class MckoiCaseFragment extends CaseFragment { public String toFragmentString() { - StringBuffer buf = new StringBuffer( cases.size() * 15 + 10 ); - StringBuffer buf2= new StringBuffer( cases.size() ); + StringBuilder buf = new StringBuilder( cases.size() * 15 + 10 ); + StringBuilder buf2= new StringBuilder( cases.size() ); Iterator iter = cases.entrySet().iterator(); while ( iter.hasNext() ) { diff --git a/hibernate-core/src/main/java/org/hibernate/sql/OracleJoinFragment.java b/hibernate-core/src/main/java/org/hibernate/sql/OracleJoinFragment.java index 249a45e667..b9885257bd 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/OracleJoinFragment.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/OracleJoinFragment.java @@ -33,8 +33,8 @@ import java.util.Set; */ public class OracleJoinFragment extends JoinFragment { - private StringBuffer afterFrom = new StringBuffer(); - private StringBuffer afterWhere = new StringBuffer(); + private StringBuilder afterFrom = new StringBuilder(); + private StringBuilder afterWhere = new StringBuilder(); public void addJoin(String tableName, String alias, String[] fkColumns, String[] pkColumns, JoinType joinType) { @@ -69,8 +69,8 @@ public class OracleJoinFragment extends JoinFragment { public JoinFragment copy() { OracleJoinFragment copy = new OracleJoinFragment(); - copy.afterFrom = new StringBuffer( afterFrom.toString() ); - copy.afterWhere = new StringBuffer( afterWhere.toString() ); + copy.afterFrom = new StringBuilder( afterFrom.toString() ); + copy.afterWhere = new StringBuilder( afterWhere.toString() ); return copy; } @@ -126,7 +126,7 @@ public class OracleJoinFragment extends JoinFragment { * for a filter. */ private void addLeftOuterJoinCondition(String on) { - StringBuffer buf = new StringBuffer( on ); + StringBuilder buf = new StringBuilder( on ); for ( int i = 0; i < buf.length(); i++ ) { char character = buf.charAt( i ); boolean isInsertPoint = OPERATORS.contains( new Character( character ) ) || diff --git a/hibernate-core/src/main/java/org/hibernate/sql/QueryJoinFragment.java b/hibernate-core/src/main/java/org/hibernate/sql/QueryJoinFragment.java index 06ac9d2ed6..88bbc4b36e 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/QueryJoinFragment.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/QueryJoinFragment.java @@ -32,8 +32,8 @@ import org.hibernate.dialect.Dialect; */ public class QueryJoinFragment extends JoinFragment { - private StringBuffer afterFrom = new StringBuffer(); - private StringBuffer afterWhere = new StringBuffer(); + private StringBuilder afterFrom = new StringBuilder(); + private StringBuilder afterWhere = new StringBuilder(); private Dialect dialect; private boolean useThetaStyleInnerJoins; @@ -78,8 +78,8 @@ public class QueryJoinFragment extends JoinFragment { public JoinFragment copy() { QueryJoinFragment copy = new QueryJoinFragment( dialect, useThetaStyleInnerJoins ); - copy.afterFrom = new StringBuffer( afterFrom.toString() ); - copy.afterWhere = new StringBuffer( afterWhere.toString() ); + copy.afterFrom = new StringBuilder( afterFrom.toString() ); + copy.afterWhere = new StringBuilder( afterWhere.toString() ); return copy; } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/QuerySelect.java b/hibernate-core/src/main/java/org/hibernate/sql/QuerySelect.java index a0c8c07b26..8a21409a47 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/QuerySelect.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/QuerySelect.java @@ -35,11 +35,11 @@ import org.hibernate.dialect.Dialect; public class QuerySelect { private Dialect dialect; private JoinFragment joins; - private StringBuffer select = new StringBuffer(); - private StringBuffer where = new StringBuffer(); - private StringBuffer groupBy = new StringBuffer(); - private StringBuffer orderBy = new StringBuffer(); - private StringBuffer having = new StringBuffer(); + private StringBuilder select = new StringBuilder(); + private StringBuilder where = new StringBuilder(); + private StringBuilder groupBy = new StringBuilder(); + private StringBuilder orderBy = new StringBuilder(); + private StringBuilder having = new StringBuilder(); private String comment; private boolean distinct=false; @@ -133,7 +133,7 @@ public class QuerySelect { } public String toQueryString() { - StringBuffer buf = new StringBuffer(50); + StringBuilder buf = new StringBuilder(50); if (comment!=null) buf.append("/* ").append(comment).append(" */ "); buf.append("select "); if (distinct) buf.append("distinct "); @@ -176,7 +176,7 @@ public class QuerySelect { return dialect.transformSelectString( buf.toString() ); } - private static void appendTokens(StringBuffer buf, Iterator iter) { + private static void appendTokens(StringBuilder buf, Iterator iter) { boolean lastSpaceable=true; boolean lastQuoted=false; while ( iter.hasNext() ) { diff --git a/hibernate-core/src/main/java/org/hibernate/sql/Select.java b/hibernate-core/src/main/java/org/hibernate/sql/Select.java index 127101a597..795562bb68 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/Select.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/Select.java @@ -56,7 +56,7 @@ public class Select { * Construct an SQL SELECT statement from the given clauses */ public String toStatementString() { - StringBuffer buf = new StringBuffer(guesstimatedBufferSize); + StringBuilder buf = new StringBuilder(guesstimatedBufferSize); if ( StringHelper.isNotEmpty(comment) ) { buf.append("/* ").append(comment).append(" */ "); } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/SelectFragment.java b/hibernate-core/src/main/java/org/hibernate/sql/SelectFragment.java index 6b039bbe57..a294e24ef5 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/SelectFragment.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/SelectFragment.java @@ -133,7 +133,7 @@ public class SelectFragment { } public String toFragmentString() { - StringBuffer buf = new StringBuffer( columns.size() * 10 ); + StringBuilder buf = new StringBuilder( columns.size() * 10 ); Iterator iter = columns.iterator(); Iterator columnAliasIter = columnAliases.iterator(); //HashMap columnsUnique = new HashMap(); diff --git a/hibernate-core/src/main/java/org/hibernate/sql/SimpleSelect.java b/hibernate-core/src/main/java/org/hibernate/sql/SimpleSelect.java index 852136511c..17d6ca0646 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/SimpleSelect.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/SimpleSelect.java @@ -147,7 +147,7 @@ public class SimpleSelect { } public String toStatementString() { - StringBuffer buf = new StringBuffer( + StringBuilder buf = new StringBuilder( columns.size()*10 + tableName.length() + whereTokens.size() * 10 + @@ -194,7 +194,7 @@ public class SimpleSelect { } public String toWhereClause() { - StringBuffer buf = new StringBuffer( whereTokens.size() * 5 ); + StringBuilder buf = new StringBuilder( whereTokens.size() * 5 ); Iterator iter = whereTokens.iterator(); while ( iter.hasNext() ) { buf.append( iter.next() ); diff --git a/hibernate-core/src/main/java/org/hibernate/sql/Sybase11JoinFragment.java b/hibernate-core/src/main/java/org/hibernate/sql/Sybase11JoinFragment.java index fbded400fc..a4d2186ad0 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/Sybase11JoinFragment.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/Sybase11JoinFragment.java @@ -34,8 +34,8 @@ package org.hibernate.sql; */ public class Sybase11JoinFragment extends JoinFragment { - private StringBuffer afterFrom = new StringBuffer(); - private StringBuffer afterWhere = new StringBuffer(); + private StringBuilder afterFrom = new StringBuilder(); + private StringBuilder afterWhere = new StringBuilder(); public void addJoin(String tableName, String alias, String[] fkColumns, String[] pkColumns, JoinType joinType) { @@ -76,8 +76,8 @@ public class Sybase11JoinFragment extends JoinFragment { public JoinFragment copy() { Sybase11JoinFragment copy = new Sybase11JoinFragment(); - copy.afterFrom = new StringBuffer( afterFrom.toString() ); - copy.afterWhere = new StringBuffer( afterWhere.toString() ); + copy.afterFrom = new StringBuilder( afterFrom.toString() ); + copy.afterWhere = new StringBuilder( afterWhere.toString() ); return copy; } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/Template.java b/hibernate-core/src/main/java/org/hibernate/sql/Template.java index 39415c7e73..f299a33b4d 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/Template.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/Template.java @@ -137,14 +137,14 @@ public final class Template { // which the tokens occur. Depending on the state of those flags we decide whether we need to qualify // identifier references. - String symbols = new StringBuffer() + String symbols = new StringBuilder() .append( "=> { @SuppressWarnings({ "UnnecessaryUnboxing" }) public String toString(Byte[] bytes) { - final StringBuffer buf = new StringBuffer(); + final StringBuilder buf = new StringBuilder(); for ( Byte aByte : bytes ) { final String hexStr = Integer.toHexString( aByte.byteValue() - Byte.MIN_VALUE ); if ( hexStr.length() == 1 ) { diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/lob/TextTest.java b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/lob/TextTest.java index 813343a030..fe995b7a3d 100644 --- a/hibernate-core/src/matrix/java/org/hibernate/test/annotations/lob/TextTest.java +++ b/hibernate-core/src/matrix/java/org/hibernate/test/annotations/lob/TextTest.java @@ -133,7 +133,7 @@ public class TextTest extends BaseCoreFunctionalTestCase { } private String buildRecursively(int size, char baseChar) { - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); for (int i = 0; i < size; i++) { buff.append(baseChar); } diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/any/ComplexPropertyValue.java b/hibernate-core/src/matrix/java/org/hibernate/test/any/ComplexPropertyValue.java index e63416df67..62f44062bb 100644 --- a/hibernate-core/src/matrix/java/org/hibernate/test/any/ComplexPropertyValue.java +++ b/hibernate-core/src/matrix/java/org/hibernate/test/any/ComplexPropertyValue.java @@ -33,7 +33,7 @@ public class ComplexPropertyValue implements PropertyValue { } private String keyString() { - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); Iterator itr = subProperties.keySet().iterator(); while ( itr.hasNext() ) { buff.append( itr.next() ); diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/cascade/circle/Node.java b/hibernate-core/src/matrix/java/org/hibernate/test/cascade/circle/Node.java index 279bbaad3c..4fa1feb566 100644 --- a/hibernate-core/src/matrix/java/org/hibernate/test/cascade/circle/Node.java +++ b/hibernate-core/src/matrix/java/org/hibernate/test/cascade/circle/Node.java @@ -115,7 +115,7 @@ public class Node { public String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append( name + " id: " + nodeID ); if ( route != null ) { diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/cascade/circle/Route.java b/hibernate-core/src/matrix/java/org/hibernate/test/cascade/circle/Route.java index 3afe8c6169..23a368162b 100644 --- a/hibernate-core/src/matrix/java/org/hibernate/test/cascade/circle/Route.java +++ b/hibernate-core/src/matrix/java/org/hibernate/test/cascade/circle/Route.java @@ -92,7 +92,7 @@ public class Route { public String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("Route name: " + name + " id: " + routeID + " transientField: " + transientField + "\n"); for (Iterator it = nodes.iterator(); it.hasNext();) { diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/cascade/circle/Transport.java b/hibernate-core/src/matrix/java/org/hibernate/test/cascade/circle/Transport.java index 74dc348636..f95ebc7bea 100644 --- a/hibernate-core/src/matrix/java/org/hibernate/test/cascade/circle/Transport.java +++ b/hibernate-core/src/matrix/java/org/hibernate/test/cascade/circle/Transport.java @@ -104,7 +104,7 @@ public class Transport { public String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append(name + " id: " + transportID + "\n"); diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/cascade/circle/Vehicle.java b/hibernate-core/src/matrix/java/org/hibernate/test/cascade/circle/Vehicle.java index 18c3ed4e39..e6c9b83e84 100644 --- a/hibernate-core/src/matrix/java/org/hibernate/test/cascade/circle/Vehicle.java +++ b/hibernate-core/src/matrix/java/org/hibernate/test/cascade/circle/Vehicle.java @@ -88,7 +88,7 @@ public class Vehicle { public String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append(name + " id: " + vehicleID + "\n"); diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/lob/ClobLocatorTest.java b/hibernate-core/src/matrix/java/org/hibernate/test/lob/ClobLocatorTest.java index a41dacfa44..0fbbcc3e71 100644 --- a/hibernate-core/src/matrix/java/org/hibernate/test/lob/ClobLocatorTest.java +++ b/hibernate-core/src/matrix/java/org/hibernate/test/lob/ClobLocatorTest.java @@ -178,7 +178,7 @@ public class ClobLocatorTest extends BaseCoreFunctionalTestCase { } public static String buildString(int size, char baseChar) { - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); for( int i = 0; i < size; i++ ) { buff.append( baseChar ); } diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/lob/LongStringTest.java b/hibernate-core/src/matrix/java/org/hibernate/test/lob/LongStringTest.java index 02df7a4056..5546b53734 100644 --- a/hibernate-core/src/matrix/java/org/hibernate/test/lob/LongStringTest.java +++ b/hibernate-core/src/matrix/java/org/hibernate/test/lob/LongStringTest.java @@ -106,7 +106,7 @@ public abstract class LongStringTest extends BaseCoreFunctionalTestCase { } private String buildRecursively(int size, char baseChar) { - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); for( int i = 0; i < size; i++ ) { buff.append( baseChar ); } diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/sql/hand/custom/CustomSQLTestSupport.java b/hibernate-core/src/matrix/java/org/hibernate/test/sql/hand/custom/CustomSQLTestSupport.java index 3b8bff8571..14e1f82a14 100644 --- a/hibernate-core/src/matrix/java/org/hibernate/test/sql/hand/custom/CustomSQLTestSupport.java +++ b/hibernate-core/src/matrix/java/org/hibernate/test/sql/hand/custom/CustomSQLTestSupport.java @@ -179,7 +179,7 @@ public abstract class CustomSQLTestSupport extends BaseCoreFunctionalTestCase { } private String buildLongString(int size, char baseChar) { - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); for( int i = 0; i < size; i++ ) { buff.append( baseChar ); } diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java b/hibernate-core/src/matrix/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java index 46b95917be..c91d5f947e 100644 --- a/hibernate-core/src/matrix/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java +++ b/hibernate-core/src/matrix/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java @@ -836,7 +836,7 @@ public class NativeSQLQueriesTest extends BaseCoreFunctionalTestCase { } private String buildLongString(int size, char baseChar) { - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); for( int i = 0; i < size; i++ ) { buff.append( baseChar ); }