HHH-15168 Fix NPE in NativeQueryImpl.ParameterInterpretationImpl#toString

This commit is contained in:
Christian Beikov 2022-04-05 12:03:26 +02:00
parent 6f0ec52e81
commit cf152d57b1
1 changed files with 6 additions and 7 deletions

View File

@ -1515,16 +1515,15 @@ public class NativeQueryImpl<R>
final StringBuilder buffer = new StringBuilder( "ParameterInterpretationImpl (" ) final StringBuilder buffer = new StringBuilder( "ParameterInterpretationImpl (" )
.append( sqlString ) .append( sqlString )
.append( ") : {" ); .append( ") : {" );
final String lineSeparator = System.lineSeparator();
for ( int i = 0, size = parameterList.size(); i < size; i++ ) { if ( CollectionHelper.isNotEmpty( parameterList ) ) {
buffer.append( System.lineSeparator() ).append( " " ); for ( int i = 0, size = parameterList.size(); i < size; i++ ) {
buffer.append( lineSeparator ).append( " ," );
if ( i != size - 1 ) {
buffer.append( "," );
} }
buffer.setLength( buffer.length() - 1 );
} }
return buffer.append( System.lineSeparator() ).append( "}" ).toString(); return buffer.append( lineSeparator ).append( "}" ).toString();
} }
} }
} }