Re: StringIndexOutOfBoundsException is thrown from String.concat

2025-05-05 Thread Alan Bateman
Can you create a bug in JBS to track this? -Alan On 05/05/2025 08:54, Andrey Turbanov wrote: Hello. I noticed that String.concat can throw StringIndexOutOfBoundsException: String r1 = "-".repeat(Integer.MAX_VALUE - 10); String r2 = "ы".repeat((Integer.MAX_VALUE - 10) / 2); System.out.println(

StringIndexOutOfBoundsException is thrown from String.concat

2025-05-05 Thread Andrey Turbanov
Hello. I noticed that String.concat can throw StringIndexOutOfBoundsException: String r1 = "-".repeat(Integer.MAX_VALUE - 10); String r2 = "ы".repeat((Integer.MAX_VALUE - 10) / 2); System.out.println(r1.concat(r2)); On JDK 24 it gives: Exception in thread "main" java.lang.StringIndexOutOfBoundsE