diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java index c4130bc5b3..30fec4d934 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java @@ -632,11 +632,9 @@ public abstract class Dialect implements ConversionContext, TypeContributor, Fun * @see AnsiSqlKeywords */ protected void registerDefaultKeywords() { - AnsiSqlKeywords keywords = new AnsiSqlKeywords(); - //Not using #registerKeyword as: - // # these are already lowercase - // # better efficiency of addAll as it can pre-size the collections - sqlKeywords.addAll( keywords.sql2003() ); + // Not using #registerKeyword() since these are already lowercase, + // better efficiency with addAll() as it can pre-size the collection + sqlKeywords.addAll( new AnsiSqlKeywords().sql2003() ); } /** @@ -673,13 +671,10 @@ public abstract class Dialect implements ConversionContext, TypeContributor, Fun */ protected Integer resolveSqlTypeCode(String columnTypeName, TypeConfiguration typeConfiguration) { final int parenthesisIndex = columnTypeName.lastIndexOf( '(' ); - final String baseTypeName; - if ( parenthesisIndex == -1 ) { - baseTypeName = columnTypeName; - } - else { - baseTypeName = columnTypeName.substring( 0, parenthesisIndex ).trim(); - } + final String baseTypeName = + parenthesisIndex == -1 + ? columnTypeName + : columnTypeName.substring( 0, parenthesisIndex ).trim(); return resolveSqlTypeCode( columnTypeName, baseTypeName, typeConfiguration ); } @@ -793,7 +788,7 @@ public abstract class Dialect implements ConversionContext, TypeContributor, Fun * @return a SQL expression that will occur in a {@code check} constraint */ public String getCheckCondition(String columnName, String[] values) { - StringBuilder check = new StringBuilder(); + final StringBuilder check = new StringBuilder(); check.append( columnName ).append( " in (" ); String separator = ""; boolean nullIsValid = false; @@ -835,7 +830,7 @@ public abstract class Dialect implements ConversionContext, TypeContributor, Fun */ @Deprecated(since="6.5", forRemoval = true) public String getCheckCondition(String columnName, long[] values) { - Long[] boxedValues = new Long[values.length]; + final Long[] boxedValues = new Long[values.length]; for ( int i = 0; i