Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
import org.hibernate.exception.spi.SQLExceptionConverter;
import org.hibernate.exception.spi.ViolatedConstraintNameExtractor;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.internal.util.collections.ArrayHelper;
import org.hibernate.loader.ast.spi.MultiKeyLoadSizingStrategy;
import org.hibernate.mapping.CheckConstraint;
Expand Down Expand Up @@ -228,6 +227,7 @@
import static org.hibernate.internal.util.MathHelper.ceilingPowerOfTwo;
import static org.hibernate.internal.util.StringHelper.isBlank;
import static org.hibernate.internal.util.StringHelper.isEmpty;
import static org.hibernate.internal.util.StringHelper.isNotEmpty;
import static org.hibernate.internal.util.StringHelper.splitAtCommas;
import static org.hibernate.internal.util.collections.ArrayHelper.EMPTY_STRING_ARRAY;
import static org.hibernate.sql.ast.internal.NonLockingClauseStrategy.NON_CLAUSE_STRATEGY;
Expand Down Expand Up @@ -5222,9 +5222,12 @@ public static String addUseIndexQueryHint(String query, String hints) {
if ( matcher.matches() && matcher.groupCount() > 1 ) {
final String startToken = matcher.group(1);
// Null if there is no join in the query
final String joinToken = Objects.toString( matcher.group(2), "" );
final String joinToken = matcher.group(2);
final String endToken = matcher.group(3);
return startToken + " use index (" + hints + ") " + joinToken + endToken;
return startToken
+ " use index (" + hints + ") "
+ ( joinToken == null ? "" : joinToken )
+ endToken;
}
else {
return query;
Expand All @@ -5242,7 +5245,7 @@ protected String prependComment(String sql, String comment) {
* Perform necessary character escaping on the text of the comment.
*/
public static String escapeComment(String comment) {
if ( StringHelper.isNotEmpty( comment ) ) {
if ( isNotEmpty( comment ) ) {
final String escaped = ESCAPE_CLOSING_COMMENT_PATTERN.matcher( comment ).replaceAll( "*\\\\/" );
return ESCAPE_OPENING_COMMENT_PATTERN.matcher( escaped ).replaceAll( "/\\\\*" );
}
Expand Down