diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/DefaultComponentSafeNamingStrategy.java b/hibernate-core/src/main/java/org/hibernate/cfg/DefaultComponentSafeNamingStrategy.java index da7d7054d9..25da374d76 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/DefaultComponentSafeNamingStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/DefaultComponentSafeNamingStrategy.java @@ -61,8 +61,7 @@ public class DefaultComponentSafeNamingStrategy extends EJB3NamingStrategy { return tableName; } else { - //use of a stringbuffer to workaround a JDK bug - return new StringBuffer( ownerEntityTable ).append( "_" ) + return new StringBuilder( ownerEntityTable ).append( "_" ) .append( associatedEntityTable != null ? associatedEntityTable : diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/DefaultNamingStrategy.java b/hibernate-core/src/main/java/org/hibernate/cfg/DefaultNamingStrategy.java index afdf979652..c184a279b3 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/DefaultNamingStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/DefaultNamingStrategy.java @@ -96,8 +96,7 @@ public class DefaultNamingStrategy implements NamingStrategy, Serializable { return tableName; } else { - //use of a stringbuffer to workaround a JDK bug - return new StringBuffer(ownerEntityTable).append("_") + return new StringBuilder(ownerEntityTable).append("_") .append( associatedEntityTable != null ? associatedEntityTable : diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/EJB3NamingStrategy.java b/hibernate-core/src/main/java/org/hibernate/cfg/EJB3NamingStrategy.java index 3b075ca6a3..bbeab2347c 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/EJB3NamingStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/EJB3NamingStrategy.java @@ -72,8 +72,7 @@ public class EJB3NamingStrategy implements NamingStrategy, Serializable { return tableName; } else { - //use of a stringbuffer to workaround a JDK bug - return new StringBuffer( ownerEntityTable ).append( "_" ) + return new StringBuilder( ownerEntityTable ).append( "_" ) .append( associatedEntityTable != null ? associatedEntityTable : 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 6487416f94..0b266cd84d 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/ImprovedNamingStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/ImprovedNamingStrategy.java @@ -110,8 +110,7 @@ public class ImprovedNamingStrategy implements NamingStrategy, Serializable { return tableName; } else { - //use of a stringbuffer to workaround a JDK bug - return new StringBuffer(ownerEntityTable).append("_") + return new StringBuilder(ownerEntityTable).append("_") .append( associatedEntityTable != null ? associatedEntityTable : 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 ab68bd667b..11fe2c5f2f 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 @@ -771,7 +771,7 @@ public class QueryTranslatorImpl extends BasicLoader implements FilterTranslator } /*private String renderOrderByPropertiesSelect() { - StringBuffer buf = new StringBuffer(10); + StringBuilder buf = new StringBuilder(10); //add the columns we are ordering by to the select ID select clause Iterator iter = orderByTokens.iterator(); diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/criteria/idclass/WidgetId.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/criteria/idclass/WidgetId.java index 58408aad0e..193677a818 100644 --- a/hibernate-core/src/test/java/org/hibernate/jpa/test/criteria/idclass/WidgetId.java +++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/criteria/idclass/WidgetId.java @@ -49,7 +49,7 @@ public class WidgetId implements Serializable { @Override public String toString( ) { - StringBuffer buf = new StringBuffer( "[id:" ); + StringBuilder buf = new StringBuilder( "[id:" ); buf.append( ( this.getCode( ) == null ) ? "null" : this.getCode( ).toString( ) ); buf.append( ";code:" ); buf.append( ( this.getDivision( ) == null ) ? "null" : this.getDivision( ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/pack/defaultpar/Version.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/pack/defaultpar/Version.java index d4f72d874b..c4d5798ddb 100644 --- a/hibernate-core/src/test/java/org/hibernate/jpa/test/pack/defaultpar/Version.java +++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/pack/defaultpar/Version.java @@ -44,6 +44,6 @@ public class Version { } public String toString() { - return new StringBuffer( major ).append( DOT ).append( minor ).append( DOT ).append( micro ).toString(); + return new StringBuilder( major ).append( DOT ).append( minor ).append( DOT ).append( micro ).toString(); } } diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/pack/defaultpar_1_0/Version1.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/pack/defaultpar_1_0/Version1.java index 83f82f97dd..0626635dda 100644 --- a/hibernate-core/src/test/java/org/hibernate/jpa/test/pack/defaultpar_1_0/Version1.java +++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/pack/defaultpar_1_0/Version1.java @@ -44,6 +44,6 @@ public class Version1 { } public String toString() { - return new StringBuffer( major ).append( DOT ).append( minor ).append( DOT ).append( micro ).toString(); + return new StringBuilder( major ).append( DOT ).append( minor ).append( DOT ).append( micro ).toString(); } } \ No newline at end of file diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/pack/war/Version.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/pack/war/Version.java index 174196e9bf..96ec605873 100644 --- a/hibernate-core/src/test/java/org/hibernate/jpa/test/pack/war/Version.java +++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/pack/war/Version.java @@ -44,6 +44,6 @@ public class Version { } public String toString() { - return new StringBuffer( major ).append( DOT ).append( minor ).append( DOT ).append( micro ).toString(); + return new StringBuilder( major ).append( DOT ).append( minor ).append( DOT ).append( micro ).toString(); } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/AlternativeNamingStrategy.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/AlternativeNamingStrategy.java index d8894bb0df..1cd67ed05b 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/AlternativeNamingStrategy.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/AlternativeNamingStrategy.java @@ -63,8 +63,7 @@ public class AlternativeNamingStrategy extends EJB3NamingStrategy { return tableName; } else { - //use of a stringbuffer to workaround a JDK bug - return new StringBuffer( ownerEntityTable ).append( "_" ) + return new StringBuilder( ownerEntityTable ).append( "_" ) .append( associatedEntityTable != null ? associatedEntityTable : diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/GetDimensionFunction.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/GetDimensionFunction.java index 0fe5fe1a38..463445c015 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/GetDimensionFunction.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/GetDimensionFunction.java @@ -23,7 +23,7 @@ class GetDimensionFunction extends SDOObjectMethod { } public String render(Type firstArgumentType, final List args, final SessionFactoryImplementor factory) { - final StringBuffer buf = new StringBuffer(); + final StringBuilder buf = new StringBuilder(); if ( args.isEmpty() ) { throw new IllegalArgumentException( "First Argument in arglist must be object to " diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/GetGeometryTypeFunction.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/GetGeometryTypeFunction.java index de18872692..1416c9390b 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/GetGeometryTypeFunction.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/GetGeometryTypeFunction.java @@ -23,7 +23,7 @@ class GetGeometryTypeFunction extends SDOObjectMethod { } public String render(Type firstArgumentType, final List args, final SessionFactoryImplementor factory) { - final StringBuffer buf = new StringBuffer(); + final StringBuilder buf = new StringBuilder(); if ( args.isEmpty() ) { throw new IllegalArgumentException( "First Argument in arglist must be object to which" diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/OracleSDOSupport.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/OracleSDOSupport.java index 2b066d561b..0026a0f600 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/OracleSDOSupport.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/OracleSDOSupport.java @@ -106,7 +106,7 @@ class OracleSDOSupport implements SpatialDialect, Serializable, WithCustomJPAFil } public String getOGCSpatialRelateSQL(String arg1, String arg2, int spatialRelation) { - final StringBuffer ogcFunction = new StringBuffer( "MDSYS." ); + final StringBuilder ogcFunction = new StringBuilder( "MDSYS." ); switch ( spatialRelation ) { case SpatialRelation.INTERSECTS: ogcFunction.append( "OGC_INTERSECTS" ); @@ -229,7 +229,7 @@ class OracleSDOSupport implements SpatialDialect, Serializable, WithCustomJPAFil */ @Override public String getSpatialFilterExpression(String columnName) { - final StringBuffer buffer = new StringBuffer( "SDO_FILTER(" ); + final StringBuilder buffer = new StringBuilder( "SDO_FILTER(" ); buffer.append( columnName ); buffer.append( ",?) = 'TRUE' " ); return buffer.toString(); @@ -245,7 +245,7 @@ class OracleSDOSupport implements SpatialDialect, Serializable, WithCustomJPAFil */ @Override public String getSpatialAggregateSQL(String columnName, int aggregation) { - final StringBuffer aggregateFunction = new StringBuffer(); + final StringBuilder aggregateFunction = new StringBuilder(); final SpatialAggregate sa = new SpatialAggregate( aggregation ); if ( sa.getAggregateSyntax() == null ) { diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/OracleSpatialFunctions.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/OracleSpatialFunctions.java index e25e5e5e87..5649256a1c 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/OracleSpatialFunctions.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/OracleSpatialFunctions.java @@ -175,7 +175,7 @@ class OracleSpatialFunctions extends SpatialFunctionsRegistry { static String getOGCSpatialAnalysisSQL(List args, int spatialAnalysisFunction) { boolean[] geomArgs; - final StringBuffer ogcFunction = new StringBuffer( "MDSYS." ); + final StringBuilder ogcFunction = new StringBuilder( "MDSYS." ); boolean isGeomReturn = true; switch ( spatialAnalysisFunction ) { case SpatialAnalysis.BUFFER: @@ -240,7 +240,7 @@ class OracleSpatialFunctions extends SpatialFunctionsRegistry { return ogcFunction.toString(); } - private static StringBuffer wrapInSTGeometry(String geomColumn, StringBuffer toAdd) { + private static StringBuilder wrapInSTGeometry(String geomColumn, StringBuilder toAdd) { return toAdd.append( "MDSYS.ST_GEOMETRY(" ).append( geomColumn ) .append( ")" ); } diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOObjectMethod.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOObjectMethod.java index e245989a17..4b3b84ccef 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOObjectMethod.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOObjectMethod.java @@ -67,7 +67,7 @@ class SDOObjectMethod implements SQLFunction { */ public String render(Type firstArgumentType, List args, SessionFactoryImplementor factory) throws QueryException { - final StringBuffer buf = new StringBuffer(); + final StringBuilder buf = new StringBuilder(); if ( args.isEmpty() ) { throw new QueryException( "First Argument in arglist must be object to which method is applied" diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOObjectProperty.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOObjectProperty.java index a1d045ea97..31dbd6f616 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOObjectProperty.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOObjectProperty.java @@ -68,7 +68,7 @@ class SDOObjectProperty implements SQLFunction { public String render(Type firstArgtype, List args, SessionFactoryImplementor factory) throws QueryException { - final StringBuffer buf = new StringBuffer(); + final StringBuilder buf = new StringBuilder(); if ( args.isEmpty() ) { throw new QueryException( "First Argument in arglist must be object of which property is queried" diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/criterion/OracleSpatialProjection.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/criterion/OracleSpatialProjection.java index fe3073d6d2..7b025f7c81 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/criterion/OracleSpatialProjection.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/criterion/OracleSpatialProjection.java @@ -49,7 +49,7 @@ public class OracleSpatialProjection extends SimpleProjection { if ( dialect instanceof SpatialDialect ) { final SpatialDialect seDialect = (SpatialDialect) dialect; - return new StringBuffer( + return new StringBuilder( seDialect.getSpatialAggregateSQL( columns[0], this.aggregate ) diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/sqlserver/SqlServerMethod.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/sqlserver/SqlServerMethod.java index 504ded5fa4..d831581f30 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/sqlserver/SqlServerMethod.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/sqlserver/SqlServerMethod.java @@ -24,7 +24,7 @@ class SqlServerMethod extends StandardSQLFunction { @Override public String render(Type firstArgumentType, List arguments, SessionFactoryImplementor sessionFactory) { - final StringBuffer buf = new StringBuffer(); + final StringBuilder buf = new StringBuilder(); if ( arguments.size() < 1 ) { buf.append( getName() ).append( "()" ); }