Re: RFR: 8266571: Sequenced Collections [v12]

2023-07-21 Thread Hollis Waite
On Fri, 21 Jul 2023 16:48:12 GMT, Stuart Marks wrote: > ListIterator fuses three different concepts: the ability to traverse forwards > and > backwards, the ability to mutate the underlying List at the current location > (add/remove/set), and the index of the current location. Which of these is

Re: RFR: 8266571: Sequenced Collections [v12]

2023-07-21 Thread Pavel Rappo
On Mon, 24 Apr 2023 21:39:43 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 96 commits: > > - Merge branch 'master' into JDK-8266571-Sequen

Re: RFR: 8266571: Sequenced Collections [v12]

2023-07-21 Thread Rémi Forax
On Fri, 21 Jul 2023 16:19:35 GMT, Hollis Waite wrote: > a SequencedCollection is backed by a doubly linked list. It's up to the user > to understand performance implications. Beware of this kind of thinking, implementations of collections in the JDK change. Many hashtable implementations in o

Re: RFR: 8266571: Sequenced Collections [v12]

2023-07-21 Thread Stuart Marks
On Fri, 21 Jul 2023 16:19:35 GMT, Hollis Waite wrote: >> Stuart Marks has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 96 commits: >> >> - Merge branch 'master' into JDK-8266571-SequencedCollections >> - Optimizations for Reverse

Re: RFR: 8266571: Sequenced Collections [v12]

2023-07-21 Thread Pavel Rappo
On Mon, 24 Apr 2023 21:39:43 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 96 commits: > > - Merge branch 'master' into JDK-8266571-Sequen

Re: RFR: 8266571: Sequenced Collections [v12]

2023-07-21 Thread Hollis Waite
On Mon, 24 Apr 2023 21:39:43 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 96 commits: > > - Merge branch 'master' into JDK-8266571-Sequen

Re: RFR: 8266571: Sequenced Collections [v12]

2023-07-21 Thread Pavel Rappo
On Fri, 21 Jul 2023 11:16:11 GMT, Hollis Waite wrote: >> Stuart Marks has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 96 commits: >> >> - Merge branch 'master' into JDK-8266571-SequencedCollections >> - Optimizations for Reverse

Re: RFR: 8266571: Sequenced Collections [v12]

2023-07-21 Thread Pavel Rappo
On Fri, 21 Jul 2023 11:16:11 GMT, Hollis Waite wrote: > It'd be convenient if SequencedCollection overrode Iterable.iterator() to > return a ListIterator. That would make it simpler to derive a List from > LinkedHashMap.values(). What stops you from deriving a list from LinkedHashMap.values()

Re: RFR: 8266571: Sequenced Collections [v12]

2023-07-21 Thread Rémi Forax
On Fri, 21 Jul 2023 11:16:11 GMT, Hollis Waite wrote: >> Stuart Marks has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 96 commits: >> >> - Merge branch 'master' into JDK-8266571-SequencedCollections >> - Optimizations for Reverse

Re: RFR: 8266571: Sequenced Collections [v12]

2023-07-21 Thread Hollis Waite
On Mon, 24 Apr 2023 21:39:43 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 96 commits: > > - Merge branch 'master' into JDK-8266571-Sequen

Re: RFR: 8266571: Sequenced Collections [v4]

2023-07-21 Thread Stuart Marks
On Tue, 28 Mar 2023 02:37:22 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify handling of cached keySet, values, and entrySet views. Removing

Re: RFR: 8266571: Sequenced Collections [v12]

2023-04-25 Thread Chen Liang
On Mon, 24 Apr 2023 21:39:43 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 96 commits: > > - Merge branch 'master' into JDK-8266571-Sequen

Re: RFR: 8266571: Sequenced Collections [v12]

2023-04-25 Thread Alan Bateman
On Mon, 24 Apr 2023 21:39:43 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 96 commits: > > - Merge branch 'master' into JDK-8266571-Sequen

Re: RFR: 8266571: Sequenced Collections [v7]

2023-04-25 Thread Pavel Rappo
On Thu, 20 Apr 2023 16:19:05 GMT, Stuart Marks wrote: >>> I didn't know about the need to specify `@throws` in order to generate the >>> throws-clauses in the docs. >> >> You need to explicitly inherit `@throws` only for exceptions that aren't >> mentioned in the `throws` clause. >> >>> As a

Re: RFR: 8266571: Sequenced Collections [v12]

2023-04-24 Thread Stuart Marks
On Fri, 24 Mar 2023 22:08:18 GMT, Tagir F. Valeev wrote: >> Stuart Marks has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 96 commits: >> >> - Merge branch 'master' into JDK-8266571-SequencedCollections >> - Optimizations for Reve

Re: RFR: 8266571: Sequenced Collections [v4]

2023-04-24 Thread Stuart Marks
On Thu, 30 Mar 2023 09:56:58 GMT, Tagir F. Valeev wrote: >> @liach >> >> I understand that you're suggesting adding various default implementations >> in order to make it easier for people to bring up implementations of >> SequencedCollections. However, adding default implementations to >> S

Re: RFR: 8266571: Sequenced Collections [v8]

2023-04-24 Thread Stuart Marks
On Sat, 22 Apr 2023 07:56:03 GMT, Nir Lisker wrote: >> Might not work if this map is concurrent. If isEmpty() returns false but >> then the map is emptied before the subsequent calls, next() might throw >> NSEE. The concurrent maps' iterators make sure to cache the element if >> hasNext() has

Re: RFR: 8266571: Sequenced Collections [v12]

2023-04-24 Thread Stuart Marks
On Fri, 24 Mar 2023 22:06:06 GMT, Tagir F. Valeev wrote: >> Stuart Marks has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 96 commits: >> >> - Merge branch 'master' into JDK-8266571-SequencedCollections >> - Optimizations for Reve

Re: RFR: 8266571: Sequenced Collections [v10]

2023-04-24 Thread Stuart Marks
On Sat, 22 Apr 2023 09:33:57 GMT, ExE Boss wrote: >> Stuart Marks has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Wording tweaks to SequencedMap / NavigableMap. >> - Change "The implementation in this class" to "... interface." > > sr

Re: RFR: 8266571: Sequenced Collections [v12]

2023-04-24 Thread Stuart Marks
> PR for Sequenced Collections implementation. Stuart Marks has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 96 commits: - Merge branch 'master' into JDK-8266571-SequencedCollections - Optimizations for ReverseOrderListView; check in

Re: RFR: 8266571: Sequenced Collections [v11]

2023-04-24 Thread Stuart Marks
> PR for Sequenced Collections implementation. Stuart Marks has updated the pull request incrementally with one additional commit since the last revision: Optimizations for ReverseOrderListView; check indexes in reversed domain. - Changes: - all: https://git.openjdk.org/jdk/pul

Re: RFR: 8266571: Sequenced Collections [v10]

2023-04-22 Thread ExE Boss
On Fri, 21 Apr 2023 22:33:13 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request incrementally with two additional > commits since the last revision: > > - Wording tweaks to SequencedMap / NavigableMap. > - Change "The impleme

Re: RFR: 8266571: Sequenced Collections [v2]

2023-04-22 Thread ExE Boss
On Wed, 19 Apr 2023 02:43:53 GMT, Stuart Marks wrote: >> src/java.base/share/classes/java/util/LinkedHashSet.java line 297: >> >>> 295: */ >>> 296: public SequencedSet reversed() { >>> 297: class ReverseLinkedHashSetView extends AbstractSet >>> implements SequencedSet { >> >>

Re: RFR: 8266571: Sequenced Collections [v8]

2023-04-22 Thread Nir Lisker
On Fri, 21 Apr 2023 22:14:58 GMT, Stuart Marks wrote: >> src/java.base/share/classes/java/util/SequencedMap.java line 152: >> >>> 150: var it = entrySet().iterator(); >>> 151: return it.hasNext() ? Map.Entry.copyOf(it.next()) : null; >>> 152: } >> >> Would is be better to fi

Re: RFR: 8266571: Sequenced Collections [v10]

2023-04-21 Thread Stuart Marks
> PR for Sequenced Collections implementation. Stuart Marks has updated the pull request incrementally with two additional commits since the last revision: - Wording tweaks to SequencedMap / NavigableMap. - Change "The implementation in this class" to "... interface." - Changes:

Re: RFR: 8266571: Sequenced Collections [v8]

2023-04-21 Thread Stuart Marks
On Thu, 20 Apr 2023 12:30:52 GMT, Nir Lisker wrote: >> Stuart Marks has updated the pull request incrementally with four additional >> commits since the last revision: >> >> - Add missing @throws and @since tags. >> - Convert code samples to snippets. >> - Various editorial changes. >> - Fi

Re: RFR: 8266571: Sequenced Collections [v8]

2023-04-21 Thread Stuart Marks
On Thu, 20 Apr 2023 12:09:52 GMT, Nir Lisker wrote: >> Stuart Marks has updated the pull request incrementally with four additional >> commits since the last revision: >> >> - Add missing @throws and @since tags. >> - Convert code samples to snippets. >> - Various editorial changes. >> - Fi

Re: RFR: 8266571: Sequenced Collections [v9]

2023-04-20 Thread Stuart Marks
> PR for Sequenced Collections implementation. Stuart Marks has updated the pull request incrementally with one additional commit since the last revision: Delegate more methods in the views of ReverseOrderSortedMapView. - Changes: - all: https://git.openjdk.org/jdk/pull/7387/fi

Re: RFR: 8266571: Sequenced Collections [v7]

2023-04-20 Thread Stuart Marks
On Thu, 20 Apr 2023 09:03:03 GMT, Pavel Rappo wrote: >> @pavelrappo Aggh. >> >>> I guess, this PR has converged enough for us to discuss some trivial stuff; >>> so here it goes. >> >> All this "trivial" stuff is generating a lot of work! :-) Well, no big deal, >> Joe D still has more CSR

Re: RFR: 8266571: Sequenced Collections [v8]

2023-04-20 Thread Nir Lisker
On Thu, 20 Apr 2023 04:19:55 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request incrementally with four additional > commits since the last revision: > > - Add missing @throws and @since tags. > - Convert code samples to snip

Re: RFR: 8266571: Sequenced Collections [v7]

2023-04-20 Thread Nir Lisker
On Wed, 19 Apr 2023 18:22:28 GMT, Stuart Marks wrote: >> src/java.base/share/classes/java/util/SequencedMap.java line 110: >> >>> 108: * {@code Entry} thus obtained will update a mapping in the underlying >>> map, or whether >>> 109: * it will throw an exception, or whether changes to the und

Re: RFR: 8266571: Sequenced Collections [v7]

2023-04-20 Thread Pavel Rappo
On Thu, 20 Apr 2023 04:13:57 GMT, Stuart Marks wrote: > I didn't know about the need to specify `@throws` in order to generate the > throws-clauses in the docs. You need to explicitly inherit `@throws` only for exceptions that aren't mentioned in the `throws` clause. > As an aside, I note th

Re: RFR: 8266571: Sequenced Collections [v7]

2023-04-20 Thread Nir Lisker
On Wed, 19 Apr 2023 14:41:59 GMT, Nir Lisker wrote: >> Stuart Marks has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - Remove unnecessary 'final' from a couple places. >> - Clarify ordering of Collection.addAll and Map.putAll; add link

Re: RFR: 8266571: Sequenced Collections [v8]

2023-04-19 Thread Stuart Marks
On Fri, 24 Mar 2023 22:16:54 GMT, Tagir F. Valeev wrote: >> Stuart Marks has updated the pull request incrementally with four additional >> commits since the last revision: >> >> - Add missing @throws and @since tags. >> - Convert code samples to snippets. >> - Various editorial changes. >>

Re: RFR: 8266571: Sequenced Collections [v8]

2023-04-19 Thread Stuart Marks
On Fri, 24 Mar 2023 22:13:29 GMT, Tagir F. Valeev wrote: >> Stuart Marks has updated the pull request incrementally with four additional >> commits since the last revision: >> >> - Add missing @throws and @since tags. >> - Convert code samples to snippets. >> - Various editorial changes. >>

Re: RFR: 8266571: Sequenced Collections [v8]

2023-04-19 Thread Stuart Marks
On Fri, 24 Mar 2023 22:01:11 GMT, Tagir F. Valeev wrote: >> Stuart Marks has updated the pull request incrementally with four additional >> commits since the last revision: >> >> - Add missing @throws and @since tags. >> - Convert code samples to snippets. >> - Various editorial changes. >>

Re: RFR: 8266571: Sequenced Collections [v8]

2023-04-19 Thread Stuart Marks
> PR for Sequenced Collections implementation. Stuart Marks has updated the pull request incrementally with four additional commits since the last revision: - Add missing @throws and @since tags. - Convert code samples to snippets. - Various editorial changes. - Fix up toArray(T[]) on revers

Re: RFR: 8266571: Sequenced Collections [v7]

2023-04-19 Thread Stuart Marks
On Wed, 19 Apr 2023 10:29:48 GMT, Pavel Rappo wrote: >> src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java >> line 409: >> >>> 407: * {@inheritDoc} >>> 408: */ >>> 409: public E getFirst() { >> >> Javadoc will automatically copy the specification from the

Re: RFR: 8266571: Sequenced Collections [v7]

2023-04-19 Thread Stuart Marks
On Wed, 19 Apr 2023 14:41:59 GMT, Nir Lisker wrote: >> Stuart Marks has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - Remove unnecessary 'final' from a couple places. >> - Clarify ordering of Collection.addAll and Map.putAll; add link

Re: RFR: 8266571: Sequenced Collections [v7]

2023-04-19 Thread Stuart Marks
On Wed, 19 Apr 2023 12:27:41 GMT, Nir Lisker wrote: >> Stuart Marks has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - Remove unnecessary 'final' from a couple places. >> - Clarify ordering of Collection.addAll and Map.putAll; add link

Re: RFR: 8266571: Sequenced Collections [v7]

2023-04-19 Thread Stuart Marks
On Wed, 19 Apr 2023 14:19:01 GMT, Nir Lisker wrote: >> Stuart Marks has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - Remove unnecessary 'final' from a couple places. >> - Clarify ordering of Collection.addAll and Map.putAll; add link

Re: RFR: 8266571: Sequenced Collections [v7]

2023-04-19 Thread Stuart Marks
On Wed, 19 Apr 2023 10:06:38 GMT, Nir Lisker wrote: >> Stuart Marks has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - Remove unnecessary 'final' from a couple places. >> - Clarify ordering of Collection.addAll and Map.putAll; add link

Re: RFR: 8266571: Sequenced Collections [v7]

2023-04-19 Thread Stuart Marks
On Wed, 19 Apr 2023 09:43:44 GMT, Nir Lisker wrote: >> Stuart Marks has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - Remove unnecessary 'final' from a couple places. >> - Clarify ordering of Collection.addAll and Map.putAll; add link

Re: RFR: 8266571: Sequenced Collections [v7]

2023-04-19 Thread Stuart Marks
On Wed, 19 Apr 2023 05:51:11 GMT, Nir Lisker wrote: >> Stuart Marks has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - Remove unnecessary 'final' from a couple places. >> - Clarify ordering of Collection.addAll and Map.putAll; add link

Re: RFR: 8266571: Sequenced Collections [v7]

2023-04-19 Thread Nir Lisker
On Wed, 19 Apr 2023 03:37:05 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request incrementally with three additional > commits since the last revision: > > - Remove unnecessary 'final' from a couple places. > - Clarify orderin

Re: RFR: 8266571: Sequenced Collections [v7]

2023-04-19 Thread Pavel Rappo
On Wed, 19 Apr 2023 04:36:28 GMT, Chen Liang wrote: > Javadoc will automatically copy the specification from the overridden method, > so the javadoc block is not necessary and can be replaced by an `@Override` > to indicate inheritance. I guess, this PR has converged enough for us to discuss s

Re: RFR: 8266571: Sequenced Collections [v7]

2023-04-18 Thread Chen Liang
On Wed, 19 Apr 2023 03:37:05 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request incrementally with three additional > commits since the last revision: > > - Remove unnecessary 'final' from a couple places. > - Clarify orderin

Re: RFR: 8266571: Sequenced Collections [v7]

2023-04-18 Thread Chen Liang
On Wed, 19 Apr 2023 03:37:05 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request incrementally with three additional > commits since the last revision: > > - Remove unnecessary 'final' from a couple places. > - Clarify orderin

Re: RFR: 8266571: Sequenced Collections [v7]

2023-04-18 Thread Stuart Marks
> PR for Sequenced Collections implementation. Stuart Marks has updated the pull request incrementally with three additional commits since the last revision: - Remove unnecessary 'final' from a couple places. - Clarify ordering of Collection.addAll and Map.putAll; add links to encounter ord

Re: RFR: 8266571: Sequenced Collections [v2]

2023-04-18 Thread Stuart Marks
On Sat, 25 Mar 2023 07:25:33 GMT, Rémi Forax wrote: >> Stuart Marks has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - More specification tweaks. >> - Add simple overrides to ArrayList. > > src/java.base/share/classes/java/util/LinkedHas

Re: RFR: 8266571: Sequenced Collections [v4]

2023-04-18 Thread Stuart Marks
On Thu, 30 Mar 2023 09:23:04 GMT, Tagir F. Valeev wrote: >> Stuart Marks has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Simplify handling of cached keySet, values, and entrySet views. > > src/java.base/share/classes/java/util/SequencedC

Re: RFR: 8266571: Sequenced Collections [v2]

2023-04-18 Thread Stuart Marks
On Sat, 25 Mar 2023 07:19:49 GMT, Rémi Forax wrote: >> Stuart Marks has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - More specification tweaks. >> - Add simple overrides to ArrayList. > > src/java.base/share/classes/java/util/Collectio

Re: RFR: 8266571: Sequenced Collections [v6]

2023-04-18 Thread Stuart Marks
On Fri, 24 Mar 2023 21:57:40 GMT, Tagir F. Valeev wrote: >> Stuart Marks has updated the pull request incrementally with four additional >> commits since the last revision: >> >> - Clarify LHM and LHS specs regarding semantics of reverse-ordered views. >> - Remove special-cases for reversed L

Re: RFR: 8266571: Sequenced Collections [v6]

2023-04-18 Thread Stuart Marks
> PR for Sequenced Collections implementation. Stuart Marks has updated the pull request incrementally with four additional commits since the last revision: - Clarify LHM and LHS specs regarding semantics of reverse-ordered views. - Remove special-cases for reversed LHM and LHS putAll and add.

Re: RFR: 8266571: Sequenced Collections [v4]

2023-04-17 Thread Stuart Marks
On Thu, 30 Mar 2023 11:33:14 GMT, Chen Liang wrote: >> In the JEP: >>> A sequenced collection supports common operations at either end, and it >>> supports processing the elements from first to last and from last to first >>> (i.e., forward and reverse). >> >>> The reverse-ordered view enables

Re: RFR: 8266571: Sequenced Collections [v2]

2023-04-17 Thread Stuart Marks
On Sat, 25 Mar 2023 07:34:51 GMT, Rémi Forax wrote: >> Stuart Marks has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - More specification tweaks. >> - Add simple overrides to ArrayList. > > src/java.base/share/classes/java/util/ReverseOr

Re: RFR: 8266571: Sequenced Collections [v2]

2023-04-17 Thread Stuart Marks
On Sat, 25 Mar 2023 07:28:46 GMT, Rémi Forax wrote: >> Stuart Marks has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - More specification tweaks. >> - Add simple overrides to ArrayList. > > src/java.base/share/classes/java/util/LinkedLis

Re: RFR: 8266571: Sequenced Collections [v2]

2023-04-17 Thread Stuart Marks
On Sat, 25 Mar 2023 07:15:16 GMT, Rémi Forax wrote: >> Stuart Marks has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - More specification tweaks. >> - Add simple overrides to ArrayList. > > src/java.base/share/classes/java/util/Collectio

Re: RFR: 8266571: Sequenced Collections [v5]

2023-04-17 Thread Stuart Marks
On Thu, 30 Mar 2023 09:50:51 GMT, Tagir F. Valeev wrote: >> src/java.base/share/classes/java/util/LinkedHashMap.java line 1197: >> >>> 1195: >>> 1196: public V computeIfAbsent(K key, Function>> V> mappingFunction) { >>> 1197: return base.computeIfAbsent(key, mappingFunction)

Re: RFR: 8266571: Sequenced Collections [v5]

2023-04-17 Thread Stuart Marks
On Tue, 28 Mar 2023 01:28:16 GMT, Stuart Marks wrote: >> src/java.base/share/classes/java/util/LinkedHashMap.java line 1123: >> >>> 1121: >>> 1122: public V put(K key, V value) { >>> 1123: return base.put(key, value); >> >> Why `put()` simply delegates to `base.put()` while

Re: RFR: 8266571: Sequenced Collections [v4]

2023-04-14 Thread Stuart Marks
On Thu, 30 Mar 2023 09:20:16 GMT, Tagir F. Valeev wrote: >> Stuart Marks has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Simplify handling of cached keySet, values, and entrySet views. > > src/java.base/share/classes/java/util/SequencedC

Re: RFR: 8266571: Sequenced Collections [v4]

2023-04-14 Thread Stuart Marks
On Thu, 30 Mar 2023 09:39:14 GMT, Tagir F. Valeev wrote: >> Stuart Marks has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Simplify handling of cached keySet, values, and entrySet views. > > src/java.base/share/classes/java/util/LinkedHash

Re: RFR: 8266571: Sequenced Collections [v2]

2023-04-14 Thread Stuart Marks
On Sat, 25 Mar 2023 07:09:43 GMT, Rémi Forax wrote: >> Stuart Marks has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - More specification tweaks. >> - Add simple overrides to ArrayList. > > src/java.base/share/classes/java/util/ArrayList

Re: RFR: 8266571: Sequenced Collections [v5]

2023-04-14 Thread Stuart Marks
On Thu, 3 Nov 2022 20:33:40 GMT, Chen Liang wrote: >> Stuart Marks has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 80 commits: >> >> - Merge branch 'master' into JDK-8266571-SequencedCollections >> - Simplify handling of cached

Re: RFR: 8266571: Sequenced Collections [v5]

2023-04-13 Thread Stuart Marks
> PR for Sequenced Collections implementation. Stuart Marks has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 80 commits: - Merge branch 'master' into JDK-8266571-SequencedCollections - Simplify handling of cached keySet, values, and

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-30 Thread Chen Liang
On Wed, 29 Mar 2023 21:18:02 GMT, Chen Liang wrote: >> Stuart Marks has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Simplify handling of cached keySet, values, and entrySet views. > > In the JEP: >> A sequenced collection supports common

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-30 Thread Tagir F . Valeev
On Thu, 30 Mar 2023 06:41:38 GMT, Stuart Marks wrote: >> In the JEP: >>> A sequenced collection supports common operations at either end, and it >>> supports processing the elements from first to last and from last to first >>> (i.e., forward and reverse). >> >>> The reverse-ordered view enabl

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-30 Thread Tagir F . Valeev
On Tue, 28 Mar 2023 02:37:22 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify handling of cached keySet, values, and entrySet views. src/java

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-30 Thread Tagir F . Valeev
On Fri, 24 Mar 2023 21:39:09 GMT, Tagir F. Valeev wrote: >> Stuart Marks has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Simplify handling of cached keySet, values, and entrySet views. > > src/java.base/share/classes/java/util/LinkedHash

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-29 Thread Stuart Marks
On Wed, 29 Mar 2023 21:18:02 GMT, Chen Liang wrote: >> Stuart Marks has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Simplify handling of cached keySet, values, and entrySet views. > > In the JEP: >> A sequenced collection supports common

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-29 Thread Stuart Marks
On Wed, 29 Mar 2023 13:09:52 GMT, Rémi Forax wrote: >> Stuart Marks has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Simplify handling of cached keySet, values, and entrySet views. > > This is taking a personal turn and I do not see the p

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-29 Thread Chen Liang
On Wed, 29 Mar 2023 21:18:04 GMT, Rémi Forax wrote: >> In the JEP, it says: >>> Any modifications to the original collection are visible in the view. >> >> If we don't have an efficient reversed view, I don't see a point of >> declaring a collection sequenced; same reason for declaring a >> se

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-29 Thread Chen Liang
On Wed, 29 Mar 2023 20:05:10 GMT, Rémi Forax wrote: >> @forax but this would not be a view: changes in the underlying collection >> won't be reflected > > Yes, > The spec says :"Changes to the underlying collection might or might not be > visible in this reversed view, depending upon the implem

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-29 Thread Rémi Forax
On Wed, 29 Mar 2023 20:54:15 GMT, Chen Liang wrote: >> Yes, >> The spec says :"Changes to the underlying collection might or might not be >> visible in this reversed view, depending upon the implementation." so i >> believe the default implementation i proposed is a valid implementation > > In

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-29 Thread Chen Liang
On Tue, 28 Mar 2023 02:37:22 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify handling of cached keySet, values, and entrySet views. In the J

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-29 Thread Rémi Forax
On Wed, 29 Mar 2023 19:54:48 GMT, Tagir F. Valeev wrote: >> In the same spirit, `reversed()` should also have a default implementation >> equivalent to >> >> >> Collections.unmodifiableSequenceCollection(Arrays.asList(this.toArray())).reversed() > > @forax but this would not be a view: chang

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-29 Thread Tagir F . Valeev
On Wed, 29 Mar 2023 19:20:16 GMT, Rémi Forax wrote: >> src/java.base/share/classes/java/util/SequencedCollection.java line 107: >> >>> 105: */ >>> 106: default void addFirst(E e) { >>> 107: throw new UnsupportedOperationException(); >> >> Can this be defaulted to `this.reversed

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-29 Thread Rémi Forax
On Wed, 29 Mar 2023 19:06:20 GMT, Chen Liang wrote: >> Stuart Marks has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Simplify handling of cached keySet, values, and entrySet views. > > src/java.base/share/classes/java/util/SequencedCollec

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-29 Thread Chen Liang
On Tue, 28 Mar 2023 02:37:22 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify handling of cached keySet, values, and entrySet views. src/java

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-29 Thread Eirik Bjorsnos
On Tue, 28 Mar 2023 02:37:22 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify handling of cached keySet, values, and entrySet views. > This i

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-29 Thread Rémi Forax
On Tue, 28 Mar 2023 02:37:22 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify handling of cached keySet, values, and entrySet views. This is

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-29 Thread Eirik Bjorsnos
On Wed, 29 Mar 2023 11:28:39 GMT, Rémi Forax wrote: > Hi Erik, I think you misunderstood me, currently Oracle supports most of the > development of the OpenJDK financially, that's a fact and i'm glad that > Oracle has taken that mantle because I'm remembering very well the sad state > of Java

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-29 Thread Rémi Forax
On Tue, 28 Mar 2023 02:37:22 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify handling of cached keySet, values, and entrySet views. Hi Erik,

Re: RFR: 8266571: Sequenced Collections [v2]

2023-03-29 Thread Eirik Bjorsnos
On Sat, 25 Mar 2023 08:19:18 GMT, Rémi Forax wrote: > I get that Oracle is rich, but this JEP is not only a burden for Oracle but > for the whole community. I'm going to have to call you out on this one, Remi. Since both of us are non-native Enlish speakers, I'm going to define "calling out"

Re: RFR: 8266571: Sequenced Collections [v2]

2023-03-29 Thread Rémi Forax
On Wed, 29 Mar 2023 06:52:35 GMT, ExE Boss wrote: > There is SortedMap, yes, but no sorted "collection". An interface with a special semantic for set, map or list do not have the same impact in term of number of lines to maintain than a collection with a special semantics. And java.util.Colle

Re: RFR: 8266571: Sequenced Collections [v2]

2023-03-28 Thread ExE Boss
On Tue, 28 Mar 2023 21:31:20 GMT, Rémi Forax wrote: > After all, there is no interface for non-null collections, read-only > collections, non structurally modifiable collections or sorted collections, > so why an interface for ordered collection ? There is `SortedMap`, and non‑null collection 

Re: RFR: 8266571: Sequenced Collections [v2]

2023-03-28 Thread Rémi Forax
On Tue, 28 Mar 2023 00:01:27 GMT, Stuart Marks wrote: >> This change is absolutely massive, implementing reversed() basically doubles >> the number of implementations which means multiple years of debugging / spec >> fixing. >> >> Reversing a List makes sense, reversing a LinkedHashSet/LinkedH

Re: RFR: 8266571: Sequenced Collections [v4]

2023-03-27 Thread Stuart Marks
> PR for Sequenced Collections implementation. Stuart Marks has updated the pull request incrementally with one additional commit since the last revision: Simplify handling of cached keySet, values, and entrySet views. - Changes: - all: https://git.openjdk.org/jdk/pull/7387/fil

Re: RFR: 8266571: Sequenced Collections [v3]

2023-03-27 Thread Stuart Marks
On Fri, 24 Mar 2023 21:35:22 GMT, Tagir F. Valeev wrote: >> Stuart Marks has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 78 commits: >> >> - Merge branch 'master' into JDK-8266571-SequencedCollections >> - Update copyrights. >>

Re: RFR: 8266571: Sequenced Collections [v3]

2023-03-27 Thread Stuart Marks
On Fri, 24 Mar 2023 21:28:18 GMT, Tagir F. Valeev wrote: >> Stuart Marks has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 78 commits: >> >> - Merge branch 'master' into JDK-8266571-SequencedCollections >> - Update copyrights. >>

Re: RFR: 8266571: Sequenced Collections [v2]

2023-03-27 Thread Stuart Marks
On Sat, 25 Mar 2023 08:19:18 GMT, Rémi Forax wrote: >> Stuart Marks has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - More specification tweaks. >> - Add simple overrides to ArrayList. > > This change is absolutely massive, implementing

Re: RFR: 8266571: Sequenced Collections [v3]

2023-03-27 Thread Stuart Marks
> PR for Sequenced Collections implementation. Stuart Marks has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 78 commits: - Merge branch 'master' into JDK-8266571-SequencedCollections - Update copyrights. - More specification tweaks.

Re: RFR: 8266571: Sequenced Collections [v2]

2023-03-25 Thread Rémi Forax
On Sat, 25 Mar 2023 03:54:23 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request incrementally with two additional > commits since the last revision: > > - More specification tweaks. > - Add simple overrides to ArrayList. Thi

Re: RFR: 8266571: Sequenced Collections [v2]

2023-03-25 Thread Rémi Forax
On Sat, 25 Mar 2023 03:54:23 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request incrementally with two additional > commits since the last revision: > > - More specification tweaks. > - Add simple overrides to ArrayList. src

Re: RFR: 8266571: Sequenced Collections [v2]

2023-03-25 Thread Rémi Forax
On Sat, 25 Mar 2023 03:54:23 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request incrementally with two additional > commits since the last revision: > > - More specification tweaks. > - Add simple overrides to ArrayList. src

Re: RFR: 8266571: Sequenced Collections [v2]

2023-03-25 Thread Rémi Forax
On Sat, 25 Mar 2023 03:54:23 GMT, Stuart Marks wrote: >> PR for Sequenced Collections implementation. > > Stuart Marks has updated the pull request incrementally with two additional > commits since the last revision: > > - More specification tweaks. > - Add simple overrides to ArrayList. src

Re: RFR: 8266571: Sequenced Collections [v2]

2023-03-24 Thread Stuart Marks
> PR for Sequenced Collections implementation. Stuart Marks has updated the pull request incrementally with two additional commits since the last revision: - More specification tweaks. - Add simple overrides to ArrayList. - Changes: - all: https://git.openjdk.org/jdk/pull/7387/

Re: RFR: 8266571: Sequenced Collections

2023-03-24 Thread Stuart Marks
On Fri, 24 Mar 2023 22:26:03 GMT, Tagir F. Valeev wrote: >> PR for Sequenced Collections implementation. > > Hello, Stuart! > > I'm really glad that this proposal progresses, and now we have a solid > implementation draft. In general, I like it very much. You may find a couple > of comments fr

Re: RFR: 8266571: Sequenced Collections

2023-03-24 Thread Tagir F . Valeev
On Tue, 8 Feb 2022 17:23:38 GMT, Stuart Marks wrote: > PR for Sequenced Collections implementation. Hello, Stuart! I'm really glad that this proposal progresses, and now we have a solid implementation draft. In general, I like it very much. You may find a couple of comments from me in this re

Re: RFR: 8266571: Sequenced Collections

2023-03-24 Thread Tagir F . Valeev
On Thu, 3 Nov 2022 00:49:52 GMT, Stuart Marks wrote: >> @stuart-marks What are examples of cases where it wouldn't be reasonable: >> https://github.com/openjdk/jdk/pull/7387/files#diff-2b261a88d9ed30893d24186a36ef500d284d82e8f345591fc6c44ed5ae15da4fR161 >> ? > > I had to uncomment that line to

  1   2   >