diff --git a/test/jdk/java/lang/StringBuilder/Supplementary.java b/test/jdk/java/lang/StringBuilder/Supplementary.java index 6df1d5e67b6..801c86e8d54 100644 --- a/test/jdk/java/lang/StringBuilder/Supplementary.java +++ b/test/jdk/java/lang/StringBuilder/Supplementary.java @@ -215,13 +215,13 @@ public class Supplementary { } /** - * Test codePointCount(int, int) & codePointCount() + * Test codePointCount(int, int) * * This test case assumes that * Character.codePointCount(CharSequence, int, int) works * correctly. */ - static void test5() { + static void testCodePointCountTwoArgs() { for (int i = 0; i < input.length; i++) { String s = input[i]; StringBuilder sb = new StringBuilder(s); @@ -239,11 +239,6 @@ public class Supplementary { result, expected); } - - int result = sb.codePointCount(); - int expected = Character.codePointCount(sb, 0, sb.length()); - check(result != expected, "codePointCount()", result, expected); - // test exceptions testCodePointCount(null, 0, 0, NullPointerException.class); testCodePointCount(sb, -1, length, IndexOutOfBoundsException.class); @@ -252,6 +247,24 @@ public class Supplementary { } } + /** + * Test codePointCount() + * + * This test case assumes that + * Character.codePointCount(CharSequence) works + * correctly. + */ + static void testCodePointCountNoArg() { + for (int i = 0; i < input.length; i++) { + String s = input[i]; + StringBuilder sb = new StringBuilder(s); + + int result = sb.codePointCount(); + int expected = Character.codePointCount(sb, 0, sb.length()); + check(result != expected, "codePointCount()", result, expected) + } + } + /** * Test offsetByCodePoints(int, int) *