commit | d76e7f870f1195b93f842791f6ff26f54ea0e02f | [log] [tgz] |
---|---|---|
author | Michael Osipov <michaelo@apache.org> | Wed Jun 10 11:02:57 2020 +0200 |
committer | Hervé Boutemy <herve.boutemy@free.fr> | Thu Jun 11 00:23:29 2020 +0200 |
tree | 7e0f55ed8cfcf53d63ebc35eae31ad56ca37a5a0 | |
parent | cc824ba8b42a10682e6683b0a36444e5a2be1bcc [diff] |
[MNG-6938] MavenITBootstrapTest fails with StringIndexOutOfBoundsException: String index out of range: -1 This is a regression introduced by 2c060ccf4912313eef65a5f6de0684efd7185979.
diff --git a/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java b/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java index 592ad9e..17d4d3d 100644 --- a/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java +++ b/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java
@@ -216,8 +216,15 @@ 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( '.' ); }