Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v8]

2025-04-26 Thread Markus KARG
ethod signature and JavaDocs are adapted from > `AbstractStringBuilder.getChars(...)`. > * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as > these provide sufficient coverage of all changes introduced by this PR. Markus KARG has updated the pull request incremental

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v7]

2025-04-21 Thread Markus KARG
On Sun, 23 Mar 2025 10:33:42 GMT, Markus KARG wrote: >> src/java.base/share/classes/java/nio/X-Buffer.java.template line 2356: >> >>> 2354: #end[streamableType] >>> 2355: >>> 2356: #if[char] >> >> Can we merge this with `// -- Other char st

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v5]

2025-04-18 Thread Markus KARG
On Wed, 16 Apr 2025 15:00:20 GMT, Roger Riggs wrote: >> Yeah, we already added this API to allow implementations to be more >> consistent under race condition. So for changing char sequences, this >> method's default implementation can throw IOOBE, but it is already specified >> so it is well-

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v6]

2025-04-18 Thread Markus KARG
On Fri, 18 Apr 2025 06:03:36 GMT, Alan Bateman wrote: >> Markus KARG has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Applied changes requested by Chen and Jaikiran: Unit tests for default >> implement

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v7]

2025-04-18 Thread Markus KARG
ethod signature and JavaDocs are adapted from > `AbstractStringBuilder.getChars(...)`. > * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as > these provide sufficient coverage of all changes introduced by this PR. Markus KARG has updated the pull request incremental

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v5]

2025-04-17 Thread Markus KARG
On Wed, 16 Apr 2025 17:04:07 GMT, Jaikiran Pai wrote: > > IIUC then you will be fine with a test that solely tests the default > > implementation of CharSequence.getChars()? > > Correct. And a similar separate test for `CharBuffer.getChars()` since that > one too is a new default implementatio

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v6]

2025-04-17 Thread Markus KARG
ethod signature and JavaDocs are adapted from > `AbstractStringBuilder.getChars(...)`. > * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as > these provide sufficient coverage of all changes introduced by this PR. Markus KARG has updated the pull request incremental

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v5]

2025-04-16 Thread Markus KARG
On Wed, 16 Apr 2025 16:47:33 GMT, Jaikiran Pai wrote: >It should be possible to just invoke `CharSequence.getChars()` on a >`CharSequence` instance to verify that its default method does what it >specifies. So these new tests won't be duplicating any existing test code. IIUC then you will be f

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v5]

2025-04-16 Thread Markus KARG
On Wed, 16 Apr 2025 16:29:23 GMT, Jaikiran Pai wrote: > > Nevertheless, the tests are there, so no _new_ ones are needed. We can > > duplicate them, if a majority thinks it is beneficial. > > As noted in the contribution guide > (https://openjdk.org/guide/#testing-the-jdk), regression tests ar

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v5]

2025-04-16 Thread Markus KARG
On Wed, 16 Apr 2025 16:08:21 GMT, Jaikiran Pai wrote: >> Markus KARG has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Applied changes requested by Chen: 'We might need to specify the IOOBE >> behav

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v5]

2025-04-16 Thread Markus KARG
On Sun, 30 Mar 2025 12:34:06 GMT, Markus KARG wrote: >> This Pull Request proposes an implementation for >> [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new >> method `public void getChars(int srcBegin, int srcEnd, char[] dst, int >> dstBegi

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v5]

2025-04-16 Thread Markus KARG
On Sun, 30 Mar 2025 12:34:06 GMT, Markus KARG wrote: >> This Pull Request proposes an implementation for >> [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new >> method `public void getChars(int srcBegin, int srcEnd, char[] dst, int >> dstBegi

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v5]

2025-04-16 Thread Markus KARG
On Tue, 15 Apr 2025 20:46:52 GMT, Roger Riggs wrote: >> Markus KARG has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Applied changes requested by Chen: 'We might need to specify the IOOBE >> behav

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v5]

2025-04-10 Thread Markus KARG
On Tue, 8 Apr 2025 18:12:03 GMT, Chen Liang wrote: > Should we ask hotspot compiler engineers for inputs on how useful this API is > for allowing batch/vectorized copy and eliminating overheads of defensive > copy array allocation? I have no strong feelings about that. As it looks like we rea

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v5]

2025-04-08 Thread Markus KARG
On Tue, 8 Apr 2025 16:51:06 GMT, Alan Bateman wrote: > I think the API docs in the latest draft looks okay. It mildly bothers me a > bit is that getChars is JDK 1.0 API but the trade off with doing a new API is > that it would need to be implemented by String and SB so I think the proposal > o

Re: RFR: 8353795: Add Writer.of(StringBuilder)

2025-04-06 Thread Markus KARG
On Sat, 5 Apr 2025 17:36:29 GMT, Markus KARG wrote: > This Pull Requests proposes an implementation for > [JDK-8353795](https://bugs.openjdk.org/browse/JDK-8353795): Adding the new > method `public static Writer Writer.of(StringBuilder)`, providing a > non-synchronized Writer im

Re: Request for Enhancement: java.io.Writer.of(Appendable) as an efficient alternative to java.io.StringWriter

2025-04-06 Thread Markus KARG
ty is needed). Also, we don't specify the toString behavior on the returned Writer (unlike for StringWriter); I think users should just use the toString on the StringBuilder. Chen *From:* core-libs-dev on behalf of M

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v3]

2025-04-05 Thread Markus KARG
On Wed, 26 Mar 2025 11:34:34 GMT, Markus KARG wrote: >> src/java.base/share/classes/java/lang/CharSequence.java line 307: >> >>> 305: /** >>> 306: * Characters are copied from this sequence into the >>> 307: * destination character ar

RFR: 8353795: Add Writer.of(StringBuilder)

2025-04-05 Thread Markus KARG
This Pull Requests proposes an implementation for [JDK-8353795](https://bugs.openjdk.org/browse/JDK-8353795): Adding the new method `public static Writer Writer.of(StringBuilder)`, providing a non-synchronized Writer implementation optimized for writing into `StringBuilder`. A basic test is pr

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v5]

2025-04-04 Thread Markus KARG
On Sun, 30 Mar 2025 12:34:06 GMT, Markus KARG wrote: >> This Pull Request proposes an implementation for >> [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new >> method `public void getChars(int srcBegin, int srcEnd, char[] dst, int >> dstBegi

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v4]

2025-03-30 Thread Markus KARG
On Sat, 29 Mar 2025 23:53:36 GMT, Chen Liang wrote: >> Markus KARG has updated the pull request incrementally with three additional >> commits since the last revision: >> >> - Applied changes requested by Alan: This sentence doesn't make sense, did >> s

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v5]

2025-03-30 Thread Markus KARG
ethod signature and JavaDocs are adapted from > `AbstractStringBuilder.getChars(...)`. > * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as > these provide sufficient coverage of all changes introduced by this PR. Markus KARG has updated the pull request incremental

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v4]

2025-03-29 Thread Markus KARG
ethod signature and JavaDocs are adapted from > `AbstractStringBuilder.getChars(...)`. > * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as > these provide sufficient coverage of all changes introduced by this PR. Markus KARG has updated the pull request incrementally

Re: JDK-8352891 Performance improvements to ByteArrayOutputStream

2025-03-29 Thread Markus KARG
Supporting what Alan said. Would love to see a static factory for a non-synchronized byte-array backed OutputStream, like `OutputStream::newByteArrayOutputStream`. John, if you like we can team up for authoring this, I have free capacity. Am 29.03.2025 um 09:33 schrieb Alan Bateman: On 28/03/

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v3]

2025-03-26 Thread Markus KARG
On Tue, 25 Mar 2025 13:06:07 GMT, Alan Bateman wrote: >> Markus KARG has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Removed apiNote and implNote from CharBuffer, as suggested by Chen > > src/java

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v3]

2025-03-26 Thread Markus KARG
On Tue, 25 Mar 2025 13:33:15 GMT, Alan Bateman wrote: >> Markus KARG has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Removed apiNote and implNote from CharBuffer, as suggested by Chen > > src/jav

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer

2025-03-25 Thread Markus KARG
On Sun, 23 Mar 2025 08:42:55 GMT, Chen Liang wrote: >> This Pull Request proposes an implementation for >> [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new >> method `public void getChars(int srcBegin, int srcEnd, char[] dst, int >> dstBegin)` to the `CharSequence` in

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v2]

2025-03-24 Thread Markus KARG
On Mon, 24 Mar 2025 11:38:58 GMT, Markus KARG wrote: >> src/java.base/share/classes/java/nio/X-Buffer.java.template line 1911: >> >>> 1909: * @implNote This method allows for superior performance over the >>> default >>> 1910: * implementation

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v3]

2025-03-24 Thread Markus KARG
ethod signature and JavaDocs are adapted from > `AbstractStringBuilder.getChars(...)`. > * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as > these provide sufficient coverage of all changes introduced by this PR. Markus KARG has updated the pull request incremental

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v2]

2025-03-24 Thread Markus KARG
On Mon, 24 Mar 2025 02:50:04 GMT, Chen Liang wrote: >> Markus KARG has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Applied changes requested by Chen > > src/java.base/share/classes/java/nio/X-Buffer.java.

Re: Request for Enhancement: java.io.Writer.of(Appendable) as an efficient alternative to java.io.StringWriter

2025-03-23 Thread Markus KARG
ter in a lot of behaviors and avoid the nasty issues around closing/flushing. On Sat, Mar 15, 2025, 12:58 PM Markus KARG wrote: Chen, thank you for sharing your opinion! Thinking about what you wrote about the "trifecta" complexity, I think it might be bette

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer

2025-03-23 Thread Markus KARG
On Sun, 23 Mar 2025 08:42:55 GMT, Chen Liang wrote: > Oops sorry, did a round of review but forgot to finish it :( No problem. I had the same problem several times before. 😃 - PR Comment: https://git.openjdk.org/jdk/pull/21730#issuecomment-2746137326

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v2]

2025-03-23 Thread Markus KARG
On Sun, 23 Mar 2025 04:34:29 GMT, Chen Liang wrote: >> Markus KARG has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Applied changes requested by Chen > > src/java.base/share/classes/java/lang/CharSeq

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer [v2]

2025-03-23 Thread Markus KARG
ethod signature and JavaDocs are adapted from > `AbstractStringBuilder.getChars(...)`. > * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as > these provide sufficient coverage of all changes introduced by this PR. Markus KARG has updated the pull request incremental

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer

2025-03-23 Thread Markus KARG
On Sun, 23 Mar 2025 06:43:04 GMT, Chen Liang wrote: > Indeed, we can go with Alternative A. Great to see that we finally found an agreement and nobody vetoed in the past months. 😃 As Alternative A actually is the current status already found in https://github.com/openjdk/jdk/pull/21730, and

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer

2025-03-22 Thread Markus KARG
On Sat, 26 Oct 2024 15:48:11 GMT, Markus KARG wrote: > This Pull Request proposes an implementation for > [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new > method `public void getChars(int srcBegin, int srcEnd, char[] dst, int > dstBegin)` to the `

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer

2025-03-22 Thread Markus KARG
On Sat, 26 Oct 2024 15:48:11 GMT, Markus KARG wrote: > This Pull Request proposes an implementation for > [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new > method `public void getChars(int srcBegin, int srcEnd, char[] dst, int > dstBegin)` to the `

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer

2025-03-15 Thread Markus KARG
On Sat, 26 Oct 2024 15:48:11 GMT, Markus KARG wrote: > This Pull Request proposes an implementation for > [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new > method `public void getChars(int srcBegin, int srcEnd, char[] dst, int > dstBegin)` to the `

Re: Request for Enhancement: java.io.Writer.of(Appendable) as an efficient alternative to java.io.StringWriter

2025-03-15 Thread Markus KARG
Chen, thank you for sharing your opinion! Thinking about what you wrote about the "trifecta" complexity, I think it might be better to restart my idea from scratch: As explained in my original proposal (https://mail.openjdk.org/pipermail/core-libs-dev/2024-December/137807.html), the actual

Re: adding Xalan's XSL 3 implementation within jdk

2025-02-26 Thread Markus KARG
pache, or to drop bundling of Xalan at all, asking people to download it manually. -Markus Karg Am 26.02.2025 um 16:59 schrieb Mukul Gandhi: Hi Alan, I've just seen this mail from you. Apologies for a delayed response. My mail box has had few issues due to the volume of mails that

Re: Request for Enhancement: java.io.Writer.of(Appendable) as an efficient alternative to java.io.StringWriter

2025-02-09 Thread Markus KARG
ed to nominate more. -Markus Am 09.02.2025 um 20:27 schrieb Alan Bateman: On 26/01/2025 16:37, Markus KARG wrote: As there have not been any more comments so far in the past weeks, I assume there is common agreement with my current proposal. I don't think you can assume this. There are

Re: Request for Comments: Adding bulk-read method "CharSequence.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)"

2025-02-09 Thread Markus KARG
As recently announced, kindly inviting everybody to contribute / review / comment on https://github.com/openjdk/jdk/pull/21730. Thank you! -Markus Karg Am 09.02.2025 um 19:34 schrieb Markus KARG: Thank you, everybody. As no more comments arrived in the past eight weeks, I assume that there

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer

2025-02-09 Thread Markus KARG
On Sat, 26 Oct 2024 17:09:29 GMT, Markus KARG wrote: >> src/java.base/share/classes/java/lang/CharSequence.java line 338: >> >>> 336: * @since 24 >>> 337: */ >>> 338: public default void getChars(int srcBegin, int srcEnd, char[] dst, &

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer

2025-02-09 Thread Markus KARG
On Sat, 26 Oct 2024 16:19:32 GMT, Rob Spoor wrote: >> This Pull Request proposes an implementation for >> [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new >> method `public void getChars(int srcBegin, int srcEnd, char[] dst, int >> dstBegin)` to the `CharSequence` int

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer

2025-02-09 Thread Markus KARG
On Sat, 26 Oct 2024 16:26:29 GMT, Chen Liang wrote: > Sorry for belated mail response, but I think we should design the API to not > take source start/end. I think JIT can escape analysis the new String in > practice. Chen, thank you for chiming in! There is nothing to be sorry, I was just po

RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer

2025-02-09 Thread Markus KARG
This Pull Request proposes an implementation for [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new method `public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` to the `CharSequence` interface, providing a **bulk-read** facility including a default i

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer

2025-02-09 Thread Markus KARG
On Sat, 26 Oct 2024 15:48:11 GMT, Markus KARG wrote: > This Pull Request proposes an implementation for > [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new > method `public void getChars(int srcBegin, int srcEnd, char[] dst, int > dstBegin)` to the `

Re: Request for Comments: Adding bulk-read method "CharSequence.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)"

2025-02-09 Thread Markus KARG
Thank you, everybody. As no more comments arrived in the past eight weeks, I assume that there is implicit agreement with my latest arguments (see below), so next I will provide a PR to continue discussion with real Java code at hand. -Markus Am 01.12.2024 um 19:23 schrieb Markus Karg: As

Re: Request for Enhancement: java.io.Writer.of(Appendable) as an efficient alternative to java.io.StringWriter

2025-01-26 Thread Markus KARG
As there have not been any more comments so far in the past weeks, I assume there is common agreement with my current proposal. If not, please chime in ASAP. If there are no further comments, I will continue with the existing PR next. -Markus Am 31.12.2024 um 14:43 schrieb Markus KARG

Re: I want to contribute openjdk data structure(like. arrayList)

2025-01-04 Thread Markus KARG
Welcome to OpenJDK! Your next step should be reading this document: https://openjdk.org/guide/ :-) Regards -Markus Am 04.01.2025 um 07:23 schrieb 임민수: hello. In order to contribute to openJDK, I had to subscribe to the email. Can I know what happens after that? I would like to partic

Re: Request for Enhancement: java.io.Writer.of(Appendable) as an efficient alternative to java.io.StringWriter

2024-12-31 Thread Markus KARG
lf; all other methods return void). We will always require all 3 arguments to be passed; a null component means the caller knowingly demands no-op behavior for that component. I believe this approach would be safer, and avoids the accidental delegation of unwanted features from a given input Ap

Re: Request for Enhancement: java.io.Writer.of(Appendable) as an efficient alternative to java.io.StringWriter

2024-12-28 Thread Markus KARG
ile the base Writer does. So Writer.of cannot adequately replace StringWriter without use-site ugliness, until we have generic types that represent the bottom type. Regards, Chen Liang On Fri, Dec 20, 2024, 11:12 PM Markus KARG wrote: Dear Sirs, JDK 24 comes with Reader.of(CharSeq

Request for Enhancement: java.io.Writer.of(Appendable) as an efficient alternative to java.io.StringWriter

2024-12-20 Thread Markus KARG
ter). In particular it makes it impossible to opt-in for the below option: Option: - Once we have Writer.of(Appendable), we could replace the full implementation of StringWriter by synchronized calls to the new Writer. This would reduce duplicate code. Kindly requesting comments. -Markus Karg

RE: Request for Comments: Adding bulk-read method "CharSequence.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)"

2024-12-01 Thread Markus Karg
. -Markus Von: Markus Karg [mailto:mar...@headcrashing.eu] Gesendet: Sonntag, 27. Oktober 2024 09:44 An: 'core-libs-dev' Betreff: Request for Comments: Adding bulk-read method "CharSequence.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)" >Hi Markus, >S

AW: RFR: 8341566: Add Reader.of(CharSequence) [v15]

2024-11-24 Thread Markus Karg
bs-dev-r...@openjdk.org] Im Auftrag von Alan Bateman Gesendet: Sonntag, 24. November 2024 15:50 An: core-libs-dev@openjdk.org Betreff: Re: RFR: 8341566: Add Reader.of(CharSequence) [v15] On Sat, 23 Nov 2024 15:08:38 GMT, Markus KARG wrote: > I have drafted a release note for > [JDK-834

Re: RFR: 8341566: Add Reader.of(CharSequence) [v15]

2024-11-23 Thread Markus KARG
On Wed, 23 Oct 2024 08:58:30 GMT, Markus KARG wrote: >> This Pull Requests proposes an implementation for >> [JDK-8341566](https://bugs.openjdk.org/browse/JDK-8341566): Adding the new >> method `public static Reader Reader.of(CharSequence)` will return an >> ano

Request for Comments: Adding bulk-read method "CharSequence.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)"

2024-10-27 Thread Markus Karg
>Hi Markus, >Should we drop the srcBigin/srcEnd parameters, as they can be replaced by a subSequence(srcBegin, srcEnd) call? Chen, I do understand your idea and while originally I had the same in mind (it really is appealing!), I came up with a draft using the original String.getChars() signature

Request for Comments: Adding bulk-read method "CharSequence.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)"

2024-10-26 Thread Markus Karg
Dear Sirs, apparently my opening of PR and CSR in DRAFT state gave the impression that these documents are published to request reviews. This is NOT the case! Both documents are still and fully intentionally in DRAFT state. I published them solely for the purpose of a public storage of my w

AW: Request for Comments: Adding bulk-read method "CharSequence.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)"

2024-10-26 Thread Markus Karg
>Is it a follow up change/PR for various places which would benefit from using >the new method? Yes, there will be a subsequent PR for various places other than Reader.of(CharSequence). -Markus

AW: Request for Comments: Adding bulk-read method "CharSequence.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)"

2024-10-26 Thread Markus Karg
mstag, 26. Oktober 2024 18:06 An: Markus Karg Cc: core-libs-dev Betreff: Re: Request for Comments: Adding bulk-read method "CharSequence.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)" Hi Markus, Should we drop the srcBigin/srcEnd parameters, as they can be replaced by

Re: RFR: 8341566: Add Reader.of(CharSequence) [v11]

2024-10-26 Thread Markus KARG
On Tue, 15 Oct 2024 10:43:54 GMT, Markus KARG wrote: >> That had been discussed here: >> https://github.com/openjdk/jdk/pull/21371#pullrequestreview-2350588453 > > Stay tuned. I have already forwarded a subsequent RFE and PR to cover this > topic. 🤩 I just file

Re: RFR: 8341566: Add Reader.of(CharSequence) [v3]

2024-10-26 Thread Markus KARG
On Tue, 8 Oct 2024 09:06:42 GMT, Markus KARG wrote: >> I believe this batch operation would be a useful addition, but it is best >> reserved for another RFE. > > Agree to Chen. As I already wrote in [the > RFE](https://bugs.openjdk.org/browse/JDK-8341566): >>As thi

Request for Comments: Adding bulk-read method "CharSequence.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)"

2024-10-25 Thread Markus Karg
I hereby request for comments on the proposal to generalize the existing method "String.getChars()"'s signature to become a new default interface method "CharSequence.getChars()". Problem For performance reasons, many CharSequence implementations, in particular String, StringBuilder, String

Integrated: 8341566: Add Reader.of(CharSequence)

2024-10-25 Thread Markus KARG
On Sat, 5 Oct 2024 16:32:39 GMT, Markus KARG wrote: > This Pull Requests proposes an implementation for > [JDK-8341566](https://bugs.openjdk.org/browse/JDK-8341566): Adding the new > method `public static Reader Reader.of(CharSequence)` will return an > anonymous, non-

Re: RFR: 8341566: Add Reader.of(CharSequence) [v15]

2024-10-24 Thread Markus KARG
On Wed, 23 Oct 2024 22:15:34 GMT, Kevin Bourrillion wrote: > An issue with the simple name `of` is that we may encounter calls like this: > > `Reader.of("/usr/share/dict/words")` > > ... that may look like they do something different. I can't say whether we > should consider this a serious iss

Re: RFR: 8341566: Add Reader.of(CharSequence) [v15]

2024-10-23 Thread Markus KARG
On Wed, 23 Oct 2024 08:58:30 GMT, Markus KARG wrote: >> This Pull Requests proposes an implementation for >> [JDK-8341566](https://bugs.openjdk.org/browse/JDK-8341566): Adding the new >> method `public static Reader Reader.of(CharSequence)` will return an >> ano

Re: RFR: 8341566: Add Reader.of(CharSequence) [v14]

2024-10-23 Thread Markus KARG
On Mon, 21 Oct 2024 17:06:30 GMT, Chen Liang wrote: >> Will the Reader need to catch IndexOutOfBoundsException and >> BufferUnderFlowException then wrap them as EOFException? I would think these >> errors should not escape the Reader as is if a source CharBuffer limit is >> tampered with. Or

Re: RFR: 8341566: Add Reader.of(CharSequence) [v15]

2024-10-23 Thread Markus KARG
On Wed, 23 Oct 2024 08:58:30 GMT, Markus KARG wrote: >> This Pull Requests proposes an implementation for >> [JDK-8341566](https://bugs.openjdk.org/browse/JDK-8341566): Adding the new >> method `public static Reader Reader.of(CharSequence)` will return an >> ano

Re: RFR: 8341566: Add Reader.of(CharSequence) [v15]

2024-10-23 Thread Markus KARG
> Wherever new JavaDocs were added, existing phrases from other code locations > have been copied and adapted, to best match the same wording. Markus KARG has updated the pull request incrementally with two additional commits since the last revision: - Fixed wording as proposed by Alan Batem

Re: RFR: 8341566: Add Reader.of(CharSequence) [v14]

2024-10-22 Thread Markus KARG
On Mon, 21 Oct 2024 15:44:58 GMT, Markus KARG wrote: >> This Pull Requests proposes an implementation for >> [JDK-8341566](https://bugs.openjdk.org/browse/JDK-8341566): Adding the new >> method `public static Reader Reader.of(CharSequence)` will return an >> ano

Re: RFR: 8341566: Add Reader.of(CharSequence)

2024-10-22 Thread Markus KARG
On Wed, 9 Oct 2024 10:40:53 GMT, Alan Bateman wrote: >>> @AlanBateman Can you please review [the CSR >>> request](https://bugs.openjdk.org/browse/JDK-8341596) so I can finish it? >>> Thanks! >> >> Latest API docs looks good, will you update the CSR? > >> @AlanBateman WDYT? > > A title like "A

Re: RFR: 8341566: Add Reader.of(CharSequence) [v14]

2024-10-21 Thread Markus KARG
> Wherever new JavaDocs were added, existing phrases from other code locations > have been copied and adapted, to best match the same wording. Markus KARG has updated the pull request incrementally with one additional commit since the last revision: Fixed wording according to CSR discus

Re: RFR: 8341566: Add Reader.of(CharSequence) [v13]

2024-10-21 Thread Markus KARG
> Wherever new JavaDocs were added, existing phrases from other code locations > have been copied and adapted, to best match the same wording. Markus KARG has updated the pull request incrementally with one additional commit since the last revision: Added wording provided by Alan Bateman

Re: RFR: 8341566: Add Reader.of(CharSequence) [v12]

2024-10-20 Thread Markus KARG
On Sun, 20 Oct 2024 10:20:57 GMT, Markus KARG wrote: >> This Pull Requests proposes an implementation for >> [JDK-8341566](https://bugs.openjdk.org/browse/JDK-8341566): Adding the new >> method `public static Reader Reader.of(CharSequence)` will return an >> ano

Re: RFR: 8341566: Add Reader.of(CharSequence) [v12]

2024-10-20 Thread Markus KARG
> Wherever new JavaDocs were added, existing phrases from other code locations > have been copied and adapted, to best match the same wording. Markus KARG has updated the pull request incrementally with one additional commit since the last revision: Removed redundant JavaDoc secti

Re: RFR: 8341566: Add Reader.of(CharSequence) [v11]

2024-10-15 Thread Markus KARG
On Mon, 14 Oct 2024 20:01:42 GMT, Rob Spoor wrote: >> src/java.base/share/classes/java/io/Reader.java line 214: >> >>> 212: cbuf[off + i] = cs.charAt(next + i); >>> 213: } >>> 214: } >> >> Just a drive-by observation, not for this

Re: RFR: 8341566: Add Reader.of(CharSequence) [v11]

2024-10-12 Thread Markus KARG
On Sat, 12 Oct 2024 08:24:37 GMT, Jaikiran Pai wrote: >> Markus KARG has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Revert 'inc should be faster than add on most CPUs' > > test/jdk/java/io/

Re: RFR: 8341566: Add Reader.of(CharSequence) [v11]

2024-10-12 Thread Markus KARG
On Sat, 12 Oct 2024 07:47:56 GMT, Markus KARG wrote: >> This Pull Requests proposes an implementation for >> [JDK-8341566](https://bugs.openjdk.org/browse/JDK-8341566): Adding the new >> method `public static Reader Reader.of(CharSequence)` will return an >> ano

Re: RFR: 8341566: Add Reader.of(CharSequence) [v10]

2024-10-12 Thread Markus KARG
On Sat, 12 Oct 2024 06:57:40 GMT, Jaikiran Pai wrote: >> I would say this current version is fine: that's how we handle encode/decode >> loop in classes like `String`. > > I agree with Roger - the previous version you had: > > > for (int i = 0; i < n; i++) > cbuf[off + i] = cs.charAt(next

Re: RFR: 8341566: Add Reader.of(CharSequence) [v11]

2024-10-12 Thread Markus KARG
> Wherever new JavaDocs were added, existing phrases from other code locations > have been copied and adapted, to best match the same wording. Markus KARG has updated the pull request incrementally with one additional commit since the last revision: Revert 'inc should be f

Re: RFR: 8341566: Add Reader.of(CharSequence) [v10]

2024-10-11 Thread Markus KARG
On Fri, 11 Oct 2024 20:56:44 GMT, Roger Riggs wrote: >> Markus KARG has updated the pull request incrementally with one additional >> commit since the last revision: >> >> inc should be faster than add on most CPUs > > src/java.base/share/classes/java/io/R

Re: RFR: 8341566: Add Reader.of(CharSequence) [v7]

2024-10-11 Thread Markus KARG
On Wed, 9 Oct 2024 18:05:55 GMT, Chen Liang wrote: >> Markus KARG has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - assertThrows instead of expectedExceptions >> - ordered jtreg tags according recommendat

Re: RFR: 8341566: Add Reader.of(CharSequence) [v10]

2024-10-11 Thread Markus KARG
On Fri, 11 Oct 2024 20:10:54 GMT, Roger Riggs wrote: > That's fine, but talking about performance improvements because of what you > think the compiler will do isn't productive. Make the source clear and > maintainable and low maintenance. tnx Uhm... actually I thought my change *made* it clea

Re: RFR: 8341566: Add Reader.of(CharSequence) [v10]

2024-10-11 Thread Markus KARG
On Fri, 11 Oct 2024 15:21:34 GMT, Roger Riggs wrote: > > I have slightly adapted the copy loop to allow CPUs to use solely > > single-operand INC within the loop instead of dual-operand ADD. > > Did you measure a performance improvement? Compiler optimizations are more > productive than spot s

Re: RFR: 8341566: Add Reader.of(CharSequence) [v10]

2024-10-10 Thread Markus KARG
On Thu, 10 Oct 2024 22:42:19 GMT, Bernd wrote: > > I have slightly adapted the copy loop to allow CPUs to use solely > > single-operand INC within the loop instead of dual-operand ADD. > > If that makes a difference we might need to consider fixing the Compiler :) Hm... really? In fact I am no

Re: RFR: 8341566: Add Reader.of(CharSequence) [v10]

2024-10-10 Thread Markus KARG
On Thu, 10 Oct 2024 21:10:30 GMT, Markus KARG wrote: >> This Pull Requests proposes an implementation for >> [JDK-8341566](https://bugs.openjdk.org/browse/JDK-8341566): Adding the new >> method `public static Reader Reader.of(CharSequence)` will return an >> ano

Re: RFR: 8341566: Add Reader.of(CharSequence) [v10]

2024-10-10 Thread Markus KARG
> Wherever new JavaDocs were added, existing phrases from other code locations > have been copied and adapted, to best match the same wording. Markus KARG has updated the pull request incrementally with one additional commit since the last revision: inc should be faster than add on most CPU

Re: RFR: 8341566: Add Reader.of(CharSequence) [v7]

2024-10-10 Thread Markus KARG
On Thu, 10 Oct 2024 14:32:30 GMT, Roger Riggs wrote: >> I think "release 24" is fine for now as similar text exists in >> `java.util.Vector`. We can normalize such texts when we implement >> https://bugs.openjdk.org/browse/JDK-8341736. > > Please remove the reference to JDK 24; it will age rapi

Re: RFR: 8341566: Add Reader.of(CharSequence) [v7]

2024-10-10 Thread Markus KARG
On Thu, 10 Oct 2024 05:47:26 GMT, Markus KARG wrote: >> Currently uncontested locks have a performance regression after the removal >> of biased locking: A similar example with `StringBuffer` is available in >> #19513. > > I do not have any personal preferences here.

Re: RFR: 8341566: Add Reader.of(CharSequence) [v9]

2024-10-10 Thread Markus KARG
> Wherever new JavaDocs were added, existing phrases from other code locations > have been copied and adapted, to best match the same wording. Markus KARG has updated the pull request incrementally with one additional commit since the last revision: Improved wording: 'Reader.of(CharSe

Re: RFR: 8341566: Add Reader.of(CharSequence) [v7]

2024-10-10 Thread Markus KARG
On Wed, 9 Oct 2024 18:42:20 GMT, Roger Riggs wrote: >> Markus KARG has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - assertThrows instead of expectedExceptions >> - ordered jtreg tags according recommendat

Re: RFR: 8341566: Add Reader.of(CharSequence) [v7]

2024-10-10 Thread Markus KARG
On Wed, 9 Oct 2024 19:19:04 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/io/Reader.java line 161: >> >>> 159: * {@code transferTo()} methods all throw {@code IOException}. >>> 160: * >>> 161: * The returned reader supports the {@link #mark mark()} >>> operation. >>

Re: RFR: 8341566: Add Reader.of(CharSequence) [v8]

2024-10-10 Thread Markus KARG
> Wherever new JavaDocs were added, existing phrases from other code locations > have been copied and adapted, to best match the same wording. Markus KARG has updated the pull request incrementally with one additional commit since the last revision: improved wording / formatting of Jav

Re: RFR: 8341566: Add Reader.of(CharSequence) [v7]

2024-10-10 Thread Markus KARG
On Thu, 10 Oct 2024 04:50:18 GMT, Alan Bateman wrote: >> I see Alan and I have different views on the inclusion of the details. >> With only a single CharSequence argument, I can't see any ambiguity about >> the starting position. > >> I see Alan and I have different views on the inclusion of th

Re: RFR: 8341566: Add Reader.of(CharSequence) [v7]

2024-10-09 Thread Markus KARG
On Wed, 9 Oct 2024 19:14:06 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/io/StringReader.java line 38: >> >>> 36: * {@code Reader.of(String)} should generally be used in preference to >>> this one, >>> 37: * as it supports all of the same operations but it is faster, as it >>>

Re: RFR: 8341566: Add Reader.of(CharSequence) [v7]

2024-10-09 Thread Markus KARG
On Wed, 9 Oct 2024 21:12:10 GMT, Roger Riggs wrote: >> The test name follows the conventions currently applied in this folder. Feel >> free to propose a better name, I would be happy to change it. > > The test name should provide enough context so the *human* reader does not > have to hunt arou

Re: RFR: 8341566: Add Reader.of(CharSequence) [v7]

2024-10-09 Thread Markus KARG
On Wed, 9 Oct 2024 18:59:58 GMT, Roger Riggs wrote: >> Markus KARG has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - assertThrows instead of expectedExceptions >> - ordered jtreg tags according recommendat

Re: RFR: 8341566: Add Reader.of(CharSequence) [v7]

2024-10-09 Thread Markus KARG
On Wed, 9 Oct 2024 11:49:47 GMT, Markus KARG wrote: >> This Pull Requests proposes an implementation for >> [JDK-8341566](https://bugs.openjdk.org/browse/JDK-8341566): Adding the new >> method `public static Reader Reader.of(CharSequence)` will return an >> ano

Re: RFR: 8341566: Add Reader.of(CharSequence)

2024-10-09 Thread Markus KARG
On Wed, 9 Oct 2024 10:40:53 GMT, Alan Bateman wrote: >>> @AlanBateman Can you please review [the CSR >>> request](https://bugs.openjdk.org/browse/JDK-8341596) so I can finish it? >>> Thanks! >> >> Latest API docs looks good, will you update the CSR? > >> @AlanBateman WDYT? > > A title like "A

Re: RFR: 8341566: Add Reader.of(CharSequence) [v6]

2024-10-09 Thread Markus KARG
On Wed, 9 Oct 2024 07:21:48 GMT, Jaikiran Pai wrote: >> Markus KARG has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Improved wording: 'If the sequence changes while the reader is open, e.g. >>

  1   2   3   4   >