8181import org .hibernate .exception .spi .SQLExceptionConverter ;
8282import org .hibernate .exception .spi .ViolatedConstraintNameExtractor ;
8383import org .hibernate .internal .CoreMessageLogger ;
84- import org .hibernate .internal .util .StringHelper ;
8584import org .hibernate .internal .util .collections .ArrayHelper ;
8685import org .hibernate .loader .ast .spi .MultiKeyLoadSizingStrategy ;
8786import org .hibernate .mapping .CheckConstraint ;
228227import static org .hibernate .internal .util .MathHelper .ceilingPowerOfTwo ;
229228import static org .hibernate .internal .util .StringHelper .isBlank ;
230229import static org .hibernate .internal .util .StringHelper .isEmpty ;
230+ import static org .hibernate .internal .util .StringHelper .isNotEmpty ;
231231import static org .hibernate .internal .util .StringHelper .splitAtCommas ;
232232import static org .hibernate .internal .util .collections .ArrayHelper .EMPTY_STRING_ARRAY ;
233233import static org .hibernate .sql .ast .internal .NonLockingClauseStrategy .NON_CLAUSE_STRATEGY ;
@@ -5222,9 +5222,12 @@ public static String addUseIndexQueryHint(String query, String hints) {
52225222 if ( matcher .matches () && matcher .groupCount () > 1 ) {
52235223 final String startToken = matcher .group (1 );
52245224 // Null if there is no join in the query
5225- final String joinToken = Objects . toString ( matcher .group (2 ), "" );
5225+ final String joinToken = matcher .group (2 );
52265226 final String endToken = matcher .group (3 );
5227- return startToken + " use index (" + hints + ") " + joinToken + endToken ;
5227+ return startToken
5228+ + " use index (" + hints + ") "
5229+ + ( joinToken == null ? "" : joinToken )
5230+ + endToken ;
52285231 }
52295232 else {
52305233 return query ;
@@ -5242,7 +5245,7 @@ protected String prependComment(String sql, String comment) {
52425245 * Perform necessary character escaping on the text of the comment.
52435246 */
52445247 public static String escapeComment (String comment ) {
5245- if ( StringHelper . isNotEmpty ( comment ) ) {
5248+ if ( isNotEmpty ( comment ) ) {
52465249 final String escaped = ESCAPE_CLOSING_COMMENT_PATTERN .matcher ( comment ).replaceAll ( "*\\ \\ /" );
52475250 return ESCAPE_OPENING_COMMENT_PATTERN .matcher ( escaped ).replaceAll ( "/\\ \\ *" );
52485251 }
0 commit comments