test/java/lang/StringBuilder/Exceptions.java

Print this page

        

@@ -92,25 +92,25 @@
                     new StringBuilder("foo");
                 }});
 
         System.out.println("StringBuilder.replace(int start, int end, String str)");
         tryCatch("  -1, 2, \" \"",
-                 new StringIndexOutOfBoundsException(-1),
+                 new StringIndexOutOfBoundsException("start -1, end 2, length 7"),
                  new Runnable() {
                 public void run() {
                     StringBuilder sb = new StringBuilder("hilbert");
                     sb.replace(-1, 2, " ");
                 }});
         tryCatch("  7, 8, \" \"",
-                 new StringIndexOutOfBoundsException("start > length()"),
+                 new StringIndexOutOfBoundsException("start 7, end 6, length 6"),
                  new Runnable() {
                 public void run() {
                     StringBuilder sb = new StringBuilder("banach");
                     sb.replace(7, 8, " ");
                 }});
         tryCatch("  2, 1, \" \"",
-                 new StringIndexOutOfBoundsException("start > end"),
+                 new StringIndexOutOfBoundsException("start 2, end 1, length 7"),
                  new Runnable() {
                 public void run() {
                     StringBuilder sb = new StringBuilder("riemann");
                     sb.replace(2, 1, " ");
                 }});