You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2020/06/10 09:03:29 UTC

[maven-integration-testing] 01/01: [MNG-6938] MavenITBootstrapTest fails with StringIndexOutOfBoundsException: String index out of range: -1

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch MNG-6938
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit 9b161f5e32e710f30fe898e746bd5c7b619e8b5e
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Wed Jun 10 11:02:57 2020 +0200

    [MNG-6938] MavenITBootstrapTest fails with StringIndexOutOfBoundsException: String index out of range: -1
---
 .../org/apache/maven/it/AbstractMavenIntegrationTestCase.java | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

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 @@ 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( '.' );
         }