Hi Stuart,
First, thanks for you detailed reply.
On 25/03/2023 00:16, Stuart Marks wrote:
...
Yes, this has come up before, but it's been mostly theoretical. That is,
people worry about this when they hear of the idea of randomized
iteration order, but I've never heard any followup. This is
Lideström Cc: core-libs-dev Betreff: Re: The non-deterministic iteration order of Immutable Collections - Original Message -
> From: "Jens Lideström"
> To: "core-libs-dev"
> Sent: Sunday, March 26, 2023 11:38:07 AM
> Subject: Re: The non-determinis
On 26/03/2023 10:38, Jens Lideström wrote:
:
I encountered this as a problem when I tried to generate a module
dependency graph using jdeps. I had my classpath wrong and got an
error message. The error message contained a list of modules or
jar-files (I don't remember the details, unfortunate
> The problem is that everyone will have to pay for the extra storage cost for
maintaining insertion order. Even if people don't need it.
I understand that.
The main point of my message is that I think it is worth the cost, that a fixed
iteration order should be the default, and that it should
- Original Message -
> From: "Jens Lideström"
> To: "core-libs-dev"
> Sent: Sunday, March 26, 2023 11:38:07 AM
> Subject: Re: The non-deterministic iteration order of Immutable Collections
> I think Map#of and friends would be more useful and less er
On Sun, 26 Mar 2023 at 10:38, Jens Lideström wrote:
>
> I think Map#of and friends would be more useful and less error prone if they
> where to return collections that have a fixed iteration order, where the
> order is defined by the insertion order when the map is created.
The problem is that
I think Map#of and friends would be more useful and less error prone if they
where to return collections that have a fixed iteration order, where the order
is defined by the insertion order when the map is created.
### My experience with jdeps
I encountered this as a problem when I tried to ge
On 3/24/23 10:53 AM, Kasper Nielsen wrote:
Would
java.util.SequencedMap.of(...)
java.util.SequencedMap.copyOf(SequencedMap map)
java.util.SequencedSet.of(...)
java.util.SequencedSet.copyOf(SequencedSet set)
solve your problem?
I would love to see them included in JEP 431.
Should be fairly sim
On 3/24/23 10:18 AM, Chris Hegarty wrote:
I know that this has come up a number of times before, but I cannot seem to find
anything directly relevant to my use-case, or recent.
The iteration order of immutable Sets and Maps (created by the `of` factories) is
clearly unspecified - good. Code
> >>
> >> I don't (yet) want to be prescriptive in any potential solution. And I
> >> know that this has been discussed before. I mostly just want to start a
> >> conversation and see how much traction it gets.
> >>
> > Would
> > java.util.SequencedMap.of(...)
> > java.util.SequencedMap.copyOf(Sequ
> > Cc: "core-libs-dev"
> > Sent: Friday, March 24, 2023 6:53:51 PM
> > Subject: Re: The non-deterministic iteration order of Immutable
> Collections
>
> >>
> >> I don't (yet) want to be prescriptive in any potential solution. And I
> >&
- Original Message -
> From: "Kasper Nielsen"
> To: "Chris Hegarty"
> Cc: "core-libs-dev"
> Sent: Friday, March 24, 2023 6:53:51 PM
> Subject: Re: The non-deterministic iteration order of Immutable Collections
>>
>> I don't
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
https://github.com/openjdk/jdk/blob/97649489d078a3aa34a73e7f686e507f34155788/src/java.base/share/classes/java/util/ImmutableCollections.java#L76-L79
Looking at these, it seems you can add `-Xshare:dump` to VM arguments
to obtain a deterministic iteration order for the same JDK builds.
This can hel
>
> I don't (yet) want to be prescriptive in any potential solution. And I
> know that this has been discussed before. I mostly just want to start a
> conversation and see how much traction it gets.
>
Would
java.util.SequencedMap.of(...)
java.util.SequencedMap.copyOf(SequencedMap map)
java.util.Seq
It is highly dependent on the exact implementation, but the situation you
are describing us weird.
In most cases the order *is* deterministic for a read-only view (which is
the case in, for example, HashMap (and hence for HashSet)).
In a deterministic implementation the only cases where the itera
I know that this has come up a number of times before, but I cannot seem
to find anything directly relevant to my use-case, or recent.
The iteration order of immutable Sets and Maps (created by the `of`
factories) is clearly unspecified - good. Code should not depend upon
this iteration order,
17 matches
Mail list logo