On Tue, 1 Dec 2020 14:49:01 GMT, Claes Redestad <redes...@openjdk.org> wrote:

> This patch fixes a place where we failed to adjust properly for getBytes 
> taking a length rather than end offset. (Something the public API in 
> AbstractStringBuilder is apparently inconsistent about..)
> 
> Although this was caught by JCK testing, this patch adds a few trivial sanity 
> tests to get at least some sanity checking into tier1

Marked as reviewed by alanb (Reviewer).

test/jdk/java/lang/StringBuilder/Insert.java line 45:

> 43:     public void insertOffset() {
> 44:         // 8254082 made the String variant cause an AIOOBE, fixed in 
> 8257511
> 45:         assertEquals("efabc", new StringBuilder("abc").insert(0, "def",   
>                    1, 3).toString());

The change looks okay.

Changing this test, and converting to TestNG is okay too. I guess I wouldn't 
try to align the start, end on L45 as it doesn't really help readability 
(doesn't matter of course).

-------------

PR: https://git.openjdk.java.net/jdk/pull/1541

Reply via email to