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

2025-02-09 Thread Rob Spoor
On Sat, 8 Feb 2025 18:56:00 GMT, Markus KARG wrote: >> While technically not being necessary, it is definitively a good idea. I >> will add it to the draft once we actually agreed that we really want to go >> with this particular signature (see the discussion with Chen). > > Fixed in `String` a

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

2025-02-09 Thread Rob Spoor
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 `CharSequence` inter

Re: java.util.Properties: reproducible write

2024-11-26 Thread Rob Spoor
The comment provided in `store(Writer, String)` is added in addition to the date comment: if (comments != null) { writeComments(bw, comments); } writeDateComment(bw); The system property can be used to replace the date with a constant, but a) it's not possib

Re: [External] : Re: Question about Streams, Gatherers, and fetching too many elements

2024-11-13 Thread Rob Spoor
distinct() doesn't require everything to be pulled. It can push elements to the downstream as they come along for the first time. When downstream.push returns false the gatherer is done. As part of some experimentation I've implemented all intermediary operations using gatherers. Most of them

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

2024-10-14 Thread Rob Spoor
On Mon, 14 Oct 2024 19:27:00 GMT, Eirik Bjørsnøs 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' > > src/java.base/share/classes/java/io/Reader.java line 214: > >

Re: Proposal for new public class: java.io.CharSequenceReader

2024-09-29 Thread Rob Spoor
On 28/09/2024 18:15, Markus Karg wrote: - Applications could use Apache Commons IO's CharSequenceReader. As it is an open-source third-party dependency, some authors might not be allowed to use it, or may not want to carry this additional burden just for the sake of this single performance improv

Re: RFR: 8319123: Implement JEP 461: Stream Gatherers (Preview) [v14]

2024-06-12 Thread Rob Spoor
On Thu, 30 Nov 2023 14:34:32 GMT, Viktor Klang wrote: >> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) > > Viktor Klang has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 32 commits: > > - Lowering upper bounda

Re: RFR: 8322292: Rearrange comparison of fields in Record.equals() [v5]

2023-12-21 Thread Rob Spoor
On Thu, 21 Dec 2023 16:58:00 GMT, Sergey Tsypanov wrote: >> Currently if we create a record it's fields are compared in their >> declaration order. This might be ineffective in cases when two objects have >> "heavy" fields equals to each other, but different "lightweight" fields >> (heavy and

Re: RFE: support safely wrapping restricted FFM calls

2023-11-18 Thread Rob Spoor
f a native call like malloc). Such custom implementations would need to be passed around several method calls of my module. Still, this is something to consider, as it does take away restricted calls away from my module to the caller. Thanks for the hint! Rob On Thu, 16 Nov 2023 at 19:21,

Re: RFE: support safely wrapping restricted FFM calls

2023-11-16 Thread Rob Spoor
On 16/11/2023 18:15, Maurizio Cimadamore wrote: On 16/11/2023 16:54, Rob Spoor wrote: Hi Maurizio, I don't think you understand what my module is doing. For instance, it's not specifying the downcall method handles themselves, it's just making it easy to define them. Maybe

Re: RFE: support safely wrapping restricted FFM calls

2023-11-16 Thread Rob Spoor
java/lang/invoke/MethodHandles.Lookup.html#hasFullPrivilegeAccess() Maurizio On 15/11/2023 17:13, Rob Spoor wrote: Hello all, I'm working on a module that makes working with FFM easier; think of something like JNA. For instance, it allows creating structures without having to ma

RFE: support safely wrapping restricted FFM calls

2023-11-15 Thread Rob Spoor
Hello all, I'm working on a module that makes working with FFM easier; think of something like JNA. For instance, it allows creating structures without having to manually manage var handles etc. My module uses restricted mehods like AddressLayout.withTargetLayout to support pointers. Those c

Re: RFE: StringTemplate interpolation with custom function

2023-10-26 Thread Rob Spoor
ons/lang3/StringEscapeUtils.html#line.768>(template.interpolate()); On Oct 26, 2023, at 4:47 PM, Rob Spoor wrote: I've been reading up on string templates, and I think it's a very cool feature. However, writing a custom processor can be a lot of copy-paste work if you want STR but with

RFE: StringTemplate interpolation with custom function

2023-10-26 Thread Rob Spoor
I've been reading up on string templates, and I think it's a very cool feature. However, writing a custom processor can be a lot of copy-paste work if you want STR but with some extra translation applied. For instance, if I'd want to have a URL encoding processor I would have to write everythin

Re: The non-deterministic iteration order of Immutable Collections

2023-03-24 Thread Rob Spoor
Check these: * https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/util/Map.html#unmodifiable: "The iteration order of mappings is unspecified and is subject to change." * https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/util/Set.html#unmodifiable: "The iteration

Re: [BUG]Collections.unmodifiableMap(map).entrySet().iterator().forEachRemaining ismissing null check

2022-08-12 Thread Rob Spoor
I found one similar issue, https://bugs.openjdk.org/browse/JDK-8015008, but that was for an empty primitive iterator. I've created a bug report with id 9073784. On 11/08/2022 01:24, some-java-user-99206970363698485...@vodafonemail.de wrote: Hi, could you please report this at https://bugrepo

[BUG] Collections.unmodifiableMap(map).entrySet().iterator().forEachRemaining is missing null check

2022-08-06 Thread Rob Spoor
Hi, I was working on upgrading another library of mine from Java 8 to 11, and I noticed my unit tests started failing. Some debugging traced the cause back to java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet and its iterator() implementation. In Java 8, the implementation only impl