[MNG-6938] MavenITBootstrapTest fails with StringIndexOutOfBoundsException: String index out of range: -1

This is a regression introduced by 1c88bf3e1c.
This commit is contained in:
Michael Osipov 2020-06-10 11:02:57 +02:00 committed by Hervé Boutemy
parent 424691b80e
commit 0944ed2259
1 changed files with 9 additions and 2 deletions

View File

@ -216,8 +216,15 @@ public abstract class AbstractMavenIntegrationTestCase
else
{
int index = testName.indexOf( ' ' );
out.print( AnsiSupport.bold( testName.substring( 0, index ) ) );
out.print( testName.substring( index ) );
if ( index == -1 )
{
out.print( testName );
}
else
{
out.print( AnsiSupport.bold( testName.substring( 0, index ) ) );
out.print( testName.substring( index ) );
}
out.print( '.' );
}