Re: StringCharBuffer and bulk get

2025-07-02 Thread Brian Burkhalter
> On Jul 2, 2025, at 1:05 PM, Brett Okken wrote: > >> It looks like only CharBuffer.getChars is broken so the rest of the change >> can stay. I filed this issue to track it: >> >> https://bugs.openjdk.org/browse/JDK-8361299 >> >> The fix is straightforward but will break a test and require

Re: StringCharBuffer and bulk get

2025-07-02 Thread Brett Okken
> It looks like only CharBuffer.getChars is broken so the rest of the change > can stay. I filed this issue to track it: > > https://bugs.openjdk.org/browse/JDK-8361299 > > The fix is straightforward but will break a test and require a CSR. Looks like the testNG GetChars has cb.getChars(cb.posi

Re: StringCharBuffer and bulk get

2025-07-02 Thread Brian Burkhalter
On Jul 2, 2025, at 11:19 AM, Alan Bateman wrote: On 02/07/2025 16:58, Brett Okken wrote: : This makes it very difficult to pass a CharBuffer (where the position is not 0) to an api taking a CharSequence - because if that api makes a switch to start using getChars (rather than charAt), it will

Re: StringCharBuffer and bulk get

2025-07-02 Thread Alan Bateman
On 02/07/2025 16:58, Brett Okken wrote: : This makes it very difficult to pass a CharBuffer (where the position is not 0) to an api taking a CharSequence - because if that api makes a switch to start using getChars (rather than charAt), it will break. Thanks for bringing this up. It does need a

Re: StringCharBuffer and bulk get

2025-07-02 Thread Brian Burkhalter
Sorry, I intended nio-...@openjdk.org. On Jul 2, 2025, at 9:03 AM, Brian Burkhalter wrote: I think that this discussion should be redirected to nio-dev: https://mail.openjdk.org/pipermail/nio-dev/ On Jul 2, 2025, at 9:00 AM, Brett Okken wrote: Actually it looks l

Re: StringCharBuffer and bulk get

2025-07-02 Thread Brian Burkhalter
I think that this discussion should be redirected to nio-dev: https://mail.openjdk.org/pipermail/nio-dev/ On Jul 2, 2025, at 9:00 AM, Brett Okken wrote: Actually it looks like the CharBuffer java doc explicitly states that all CharSequence should be relative: This class implements the CharSequ

Re: StringCharBuffer and bulk get

2025-07-02 Thread Brett Okken
Actually it looks like the CharBuffer java doc explicitly states that all CharSequence should be relative: > This class implements the CharSequence interface so that character buffers > may be used wherever character sequences are accepted, for example in the > regular-expression package java.ut

Re: StringCharBuffer and bulk get

2025-07-02 Thread Brett Okken
My question here specifically is about treating a CharBuffer as a CharSequence. The specific issue here is that when acting as a CharSequence, all the pre-jdk25 methods are relative indexes. JDK 25 added a new method to CharSequence, but the implementation in CharBuffer uses absolute indexes. This

Re: StringCharBuffer and bulk get

2025-07-02 Thread Chen Liang
. From: core-libs-dev on behalf of Brian Burkhalter Sent: Wednesday, July 2, 2025 10:40 AM To: Brett Okken Cc: core-libs-dev Subject: Re: StringCharBuffer and bulk get Some methods are absolute and some relative: https://docs.oracle.com/en/java/javase/24/docs/api

Re: StringCharBuffer and bulk get

2025-07-02 Thread Brian Burkhalter
Some methods are absolute and some relative: https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/nio/Buffer.html#transferring-data-heading On Jul 2, 2025, at 8:35 AM, Brett Okken wrote: CharBuffer implementation of public default void getChars(int srcBegin, int srcEnd, char[] dst,

Re: StringCharBuffer and bulk get

2025-07-02 Thread Brett Okken
n > > Sent: Tuesday, July 1, 2025 9:57 AM > To: core-libs-dev > Subject: StringCharBuffer and bulk get > > jdk 25 introduced[1] a bulk getChars method to CharSequence[2]. > Should StringCharBuffer be updated to utilize that new method to > implement the bulk get method[3

Re: StringCharBuffer and bulk get

2025-07-01 Thread Chen Liang
9:57 AM To: core-libs-dev Subject: StringCharBuffer and bulk get jdk 25 introduced[1] a bulk getChars method to CharSequence[2]. Should StringCharBuffer be updated to utilize that new method to implement the bulk get method[3]? That would presumably require changes to the private getArray[4]. I

StringCharBuffer and bulk get

2025-07-01 Thread Brett Okken
jdk 25 introduced[1] a bulk getChars method to CharSequence[2]. Should StringCharBuffer be updated to utilize that new method to implement the bulk get method[3]? That would presumably require changes to the private getArray[4]. I think there could also be changes to putBuffer[5] for when the targe