Re: RFR: JDK-8311009: Long.toUnsignedString(long, int) doesn't have to create a BigInteger

2023-06-28 Thread Tingjun Yuan
On Mon, 26 Jun 2023 14:58:56 GMT, Tingjun Yuan wrote: > This PR changes the implementation of `Long.toUnsignedString(long, int)` for > "default" radices, which avoids creating a `BigInteger` and makes use of > `Long.divideUnsigned` and `Long.remainderUnsigned`. > > I

Re: RFR: JDK-8311009: Long.toUnsignedString(long, int) doesn't have to create a BigInteger [v2]

2023-06-28 Thread Tingjun Yuan
signedStringNegative 500 avgt 15 3823.655 ± 146.171 us/op > > > I've submitted a bug report for this to the [Java Bug > Database](https://bugs.java.com/bugdatabase/). No CSR needed since the > behavior is not changed. Tingjun Yuan has updated the pull reque

Re: RFR: JDK-8311009: Long.toUnsignedString(long, int) doesn't have to create a BigInteger

2023-06-27 Thread Tingjun Yuan
On Mon, 26 Jun 2023 14:58:56 GMT, Tingjun Yuan wrote: > This PR changes the implementation of `Long.toUnsignedString(long, int)` for > "default" radices, which avoids creating a `BigInteger` and makes use of > `Long.divideUnsigned` and `Long.remainderUnsigned`. > > I

RFR: JDK-8311009: Long.toUnsignedString(long, int) doesn't have to create a BigInteger

2023-06-27 Thread Tingjun Yuan
This PR changes the implementation of `Long.toUnsignedString(long, int)` for "default" radices, which avoids creating a `BigInteger` and makes use of `Long.divideUnsigned` and `Long.remainderUnsigned`. I've run the test on `test/jdk/java/lang/Long/Unsigned.java` and it works correctly. I

Re: RFR: 8305774: String.join(CharSequence, Iterable) can be optimized if Iterable is a Collection [v2]

2023-04-09 Thread Tingjun Yuan
On Sun, 9 Apr 2023 02:28:37 GMT, Tingjun Yuan wrote: >> In the current implementation of `String.join(CharSequence, Iterable)`, the >> temp array `elems` is always initialized with a length of 8. It will cause >> many array recreations when the `Iterable` contains mo

Re: RFR: 8305774: String.join(CharSequence, Iterable) can be optimized if Iterable is a Collection [v3]

2023-04-09 Thread Tingjun Yuan
ange requires a CSR request. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revision: use spliterator().estimateSize() - Changes: - all: https://git.openjdk.org/jdk/pull/13383/files - new: https://git.openjdk.org/jdk/pull/133

Re: RFR: 8305774: String.join(CharSequence, Iterable) can be optimized if Iterable is a Collection [v2]

2023-04-09 Thread Tingjun Yuan
On Sun, 9 Apr 2023 02:28:37 GMT, Tingjun Yuan wrote: >> In the current implementation of `String.join(CharSequence, Iterable)`, the >> temp array `elems` is always initialized with a length of 8. It will cause >> many array recreations when the `Iterable` contains mo

Re: RFR: 8305774: String.join(CharSequence, Iterable) can be optimized if Iterable is a Collection [v2]

2023-04-09 Thread Tingjun Yuan
On Sun, 9 Apr 2023 02:28:37 GMT, Tingjun Yuan wrote: >> In the current implementation of `String.join(CharSequence, Iterable)`, the >> temp array `elems` is always initialized with a length of 8. It will cause >> many array recreations when the `Iterable` contains mo

Re: RFR: 8305774: String.join(CharSequence, Iterable) can be optimized if Iterable is a Collection [v2]

2023-04-09 Thread Tingjun Yuan
On Mon, 10 Apr 2023 04:57:09 GMT, Glavo wrote: >> Tingjun Yuan has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add benchmark > > If you really don't trust a collection, then we can't do anything. > >

Re: RFR: 8305774: String.join(CharSequence, Iterable) can be optimized if Iterable is a Collection [v2]

2023-04-09 Thread Tingjun Yuan
On Mon, 10 Apr 2023 04:28:34 GMT, Chen Liang wrote: >> Nah. I mean like: >> >> public static String join(CharSequence delimiter, >> Iterable elements) { >> Objects.requireNonNull(delimiter); >> Objects.requireNonNull(elements); >> var delim =

Re: RFR: 8305774: String.join(CharSequence, Iterable) can be optimized if Iterable is a Collection [v2]

2023-04-09 Thread Tingjun Yuan
On Mon, 10 Apr 2023 03:36:44 GMT, Chen Liang wrote: >> Tingjun Yuan has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add benchmark > > Nah. I mean like: > > public static String join(CharSequen

Re: RFR: 8305774: String.join(CharSequence, Iterable) can be optimized if Iterable is a Collection [v2]

2023-04-09 Thread Tingjun Yuan
On Sun, 9 Apr 2023 02:28:37 GMT, Tingjun Yuan wrote: >> In the current implementation of `String.join(CharSequence, Iterable)`, the >> temp array `elems` is always initialized with a length of 8. It will cause >> many array recreations when the `Iterable` contains mo

Re: RFR: 8305774: String.join(CharSequence, Iterable) can be optimized if Iterable is a Collection [v2]

2023-04-09 Thread Tingjun Yuan
On Mon, 10 Apr 2023 03:04:20 GMT, Chen Liang wrote: >> @liach Working on that. > > @yuantj Alternatively, you can probably try working on the `toArray` result > of a collection than to allocate a new String array. This might be more > efficient for some implementations like ArrayList as well,

Re: RFR: 8305774: String.join(CharSequence, Iterable) can be optimized if Iterable is a Collection [v2]

2023-04-09 Thread Tingjun Yuan
On Sun, 9 Apr 2023 02:37:45 GMT, Tingjun Yuan wrote: >> This appears to be a 4% improvement for non-concurrent structures like >> ArrayList or LinkedHashSet, if we ignore the baseline difference (for >> Iterable). This is anticipated as the growth of array size is exponential

Re: RFR: 8305774: String.join(CharSequence, Iterable) can be optimized if Iterable is a Collection [v2]

2023-04-08 Thread Tingjun Yuan
On Sun, 9 Apr 2023 02:33:07 GMT, Chen Liang wrote: >> Tingjun Yuan has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add benchmark > > This appears to be a 4% improvement for non-concurrent structures like

Re: RFR: 8305774: String.join(CharSequence, Iterable) can be optimized if Iterable is a Collection

2023-04-08 Thread Tingjun Yuan
On Sun, 9 Apr 2023 02:11:44 GMT, jmehrens wrote: >> In the current implementation of `String.join(CharSequence, Iterable)`, the >> temp array `elems` is always initialized with a length of 8. It will cause >> many array recreations when the `Iterable` contains more than 8 elements. >>

Re: RFR: 8305774: String.join(CharSequence, Iterable) can be optimized if Iterable is a Collection

2023-04-08 Thread Tingjun Yuan
On Fri, 7 Apr 2023 08:27:18 GMT, Tingjun Yuan wrote: > In the current implementation of `String.join(CharSequence, Iterable)`, the > temp array `elems` is always initialized with a length of 8. It will cause > many array recreations when the `Iterable` contains more than 8

Re: RFR: 8305774: String.join(CharSequence, Iterable) can be optimized if Iterable is a Collection [v2]

2023-04-08 Thread Tingjun Yuan
ange requires a CSR request. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revision: Add benchmark - Changes: - all: https://git.openjdk.org/jdk/pull/13383/files - new: https://git.openjdk.org/jdk/pull/13383/files/3d4787ed.

Re: RFR: 8305774: String.join(CharSequence, Iterable) can be optimized if Iterable is a Collection

2023-04-08 Thread Tingjun Yuan
On Sat, 8 Apr 2023 23:18:04 GMT, Chen Liang wrote: >> In the current implementation of `String.join(CharSequence, Iterable)`, the >> temp array `elems` is always initialized with a length of 8. It will cause >> many array recreations when the `Iterable` contains more than 8 elements. >>

RFR: 8305774: String.join(CharSequence, Iterable) can be optimized if Iterable is a Collection

2023-04-08 Thread Tingjun Yuan
In the current implementation of `String.join(CharSequence, Iterable)`, the temp array `elems` is always initialized with a length of 8. It will cause many array recreations when the `Iterable` contains more than 8 elements. Furthermore, it's very common that an `Iterable` is also a

Integrated: JDK-8269843: typo in LinkedHashMap::removeEldestEntry spec

2023-04-06 Thread Tingjun Yuan
On Thu, 6 Apr 2023 00:49:33 GMT, Tingjun Yuan wrote: > Fix a typo in the specification of > `java.util.LinkedHashMap.removeEldestEntry(Map.Entry)`. > >> This is the entry that will be removed **it** this method returns `true`. > > will become: > >> This is

RFR: JDK-8269843: typo in LinkedHashMap::removeEldestEntry spec

2023-04-05 Thread Tingjun Yuan
Fix a typo in the specification of `java.util.LinkedHashMap.removeEldestEntry(Map.Entry)`. > This is the entry that will be removed **it** this method returns `true`. will become: > This is the entry that will be removed **if** this method returns `true`. - Commit messages: -

Re: RFR: JDK-8304945: StringBuilder and StringBuffer should implement Appendable explicitly

2023-04-03 Thread Tingjun Yuan
On Mon, 3 Apr 2023 10:23:03 GMT, Alan Bateman wrote: > > Are there more places where we "accidentally" expose interfaces via > > non-public (or even public) super classes? > > Appendable was added as part of the scanning/formatting update in Java 5. > It's intentional that SB implements

Re: RFR: JDK-8304945: StringBuilder and StringBuffer should implement Appendable explicitly

2023-04-03 Thread Tingjun Yuan
On Sat, 1 Apr 2023 17:34:37 GMT, Joe Darcy wrote: > The StringBuilder and StringBuffer classes are Appendable by virtue of from > subclasses their non-public superclass AbstractStringBuilder. > > It is slightly clearer to declare StringBuilder and StringBuffer to directly > implement

Withdrawn: 8301043: Super-interface for PrintStream and PrintWriter

2023-03-28 Thread Tingjun Yuan
On Sun, 29 Jan 2023 01:54:02 GMT, Tingjun Yuan wrote: > Add `java.io.PrintOutput` to represent print operations, and modify > `java.io.PrintStream` and `java.io.PrintWriter` to implement it. This pull request has been closed without being integrated. - PR: https://git.openj

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v5]

2023-03-22 Thread Tingjun Yuan
On Tue, 21 Mar 2023 23:41:44 GMT, Claes Redestad wrote: >> Tingjun Yuan has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Set.copyOf: need defensive copy > > If this level of complexity is indeed need

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v5]

2023-03-21 Thread Tingjun Yuan
On Tue, 21 Feb 2023 03:39:46 GMT, Tingjun Yuan wrote: >> Currently, the two subclasses of `java.util.EnumSet` optimize bulk >> operations when the argument is also a `EnumSet`, but there is no such >> optimization for wrapper sets (returned by `Collectio

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v7]

2023-03-21 Thread Tingjun Yuan
ts (returned by `Set.of` > methods) of `Enum`s. > > This PR introduces optimization classes for these situations. No public APIs > are changed. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revision: Fix a whitespace error ---

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v6]

2023-03-21 Thread Tingjun Yuan
ts (returned by `Set.of` > methods) of `Enum`s. > > This PR introduces optimization classes for these situations. No public APIs > are changed. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revision: Delete compatible interfaces an

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v5]

2023-03-21 Thread Tingjun Yuan
On Tue, 21 Feb 2023 03:39:46 GMT, Tingjun Yuan wrote: >> Currently, the two subclasses of `java.util.EnumSet` optimize bulk >> operations when the argument is also a `EnumSet`, but there is no such >> optimization for wrapper sets (returned by `Collectio

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v5]

2023-02-20 Thread Tingjun Yuan
ts (returned by `Set.of` > methods) of `Enum`s. > > This PR introduces optimization classes for these situations. No public APIs > are changed. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revision: Set.copyOf: need defensive copy

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v4]

2023-02-20 Thread Tingjun Yuan
ts (returned by `Set.of` > methods) of `Enum`s. > > This PR introduces optimization classes for these situations. No public APIs > are changed. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revision: Fix `Set.copyOf` -

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v2]

2023-02-20 Thread Tingjun Yuan
On Mon, 20 Feb 2023 13:58:01 GMT, liach wrote: > no, Set.copyOf explicitly allows duplications, unlike Set.of. You need to > read the specs so you know what you are doing. Sorry, my bad. I've fixed that. - PR: https://git.openjdk.org/jdk/pull/12498

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v2]

2023-02-20 Thread Tingjun Yuan
On Mon, 20 Feb 2023 13:29:52 GMT, Tingjun Yuan wrote: > I wonder why the original code didn't use `addAll`, so I didn't change it.  It seems to be okay to use `addAll` in all cases. Do we need extra test cases for this? - PR: https://git.openjdk.org/jdk/pull/12498

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v3]

2023-02-20 Thread Tingjun Yuan
ts (returned by `Set.of` > methods) of `Enum`s. > > This PR introduces optimization classes for these situations. No public APIs > are changed. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revision: Use `addAll` in `EnumSet.copyOf`

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v2]

2023-02-20 Thread Tingjun Yuan
On Mon, 20 Feb 2023 13:16:09 GMT, liach wrote: >> Tingjun Yuan has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Optimize `EnumSet.copyOf` and `Set.copyOf` > > src/java.base/share/classes/java/util/En

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v2]

2023-02-20 Thread Tingjun Yuan
On Mon, 20 Feb 2023 13:15:20 GMT, liach wrote: > Bad change, doesn't handle e0.equals(e1), and this is getting beyond the > original issue `Set.of(E, E)` handles duplication. If `coll` is `{Jumbo,Regular}EnumSetCompatible`, then we don't have to create the `HashSet`. - PR:

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v2]

2023-02-20 Thread Tingjun Yuan
ts (returned by `Set.of` > methods) of `Enum`s. > > This PR introduces optimization classes for these situations. No public APIs > are changed. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revision: Optimize `EnumSet

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums

2023-02-20 Thread Tingjun Yuan
On Thu, 9 Feb 2023 16:20:31 GMT, Tingjun Yuan wrote: > Currently, the two subclasses of `java.util.EnumSet` optimize bulk operations > when the argument is also a `EnumSet`, but there is no such optimization for > wrapper sets (returned by `Collections.unmodi

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums

2023-02-20 Thread Tingjun Yuan
On Thu, 9 Feb 2023 19:37:03 GMT, liach wrote: > Just curious, how does this enum set change affect the performance of > construction of regular sets via Set.of calls? See `ImmutableCollections.setFromArray`, it relies on the fact that `EnumSet.copyOf` will throw a `ClassCastException` if the

RFR: 8302818: Optimize wrapper sets and immutable sets of Enums

2023-02-20 Thread Tingjun Yuan
Currently, the two subclasses of `java.util.EnumSet` optimize bulk operations when the argument is also a `EnumSet`, but there is no such optimization for wrapper sets (returned by `Collections.unmodifiableSet`, `Collections.synchronizedSet`, etc.) and immutable sets (returned by `Set.of`

Withdrawn: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException

2023-02-15 Thread Tingjun Yuan
On Mon, 23 Jan 2023 02:35:19 GMT, Tingjun Yuan wrote: > Document `java.util.Arrays.asList` that the list will throw an > `ArrayStoreException` when attempting to set an element with a wrong type. This pull request has been closed without being integrated. - PR:

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v8]

2023-02-15 Thread Tingjun Yuan
On Thu, 16 Feb 2023 04:39:20 GMT, Stuart Marks wrote: >> I've written a CSR report for this PR as below. Could someone please help >> me to submit it to the JBS if it looks okay? Thank you! >> >> --- >> >> **Compatibility Risk:** minimum >> >> **Compatibility Risk Description:** No

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v8]

2023-02-08 Thread Tingjun Yuan
On Wed, 8 Feb 2023 23:33:20 GMT, Tingjun Yuan wrote: >> Document `java.util.Arrays.asList` that the list will throw an >> `ArrayStoreException` when attempting to set an element with a wrong type. > > Tingjun Yuan has updated the pull request incrementally with one addition

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v8]

2023-02-08 Thread Tingjun Yuan
> Document `java.util.Arrays.asList` that the list will throw an > `ArrayStoreException` when attempting to set an element with a wrong type. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revision: Update Arrays.java - C

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v7]

2023-02-07 Thread Tingjun Yuan
On Mon, 23 Jan 2023 07:33:21 GMT, Tingjun Yuan wrote: >> Document `java.util.Arrays.asList` that the list will throw an >> `ArrayStoreException` when attempting to set an element with a wrong type. > > Tingjun Yuan has updated the pull request incrementally with one addition

Re: RFR: 8301043: Super-interface for PrintStream and PrintWriter [v2]

2023-01-31 Thread Tingjun Yuan
On Tue, 31 Jan 2023 18:28:59 GMT, Alan Bateman wrote: > A PR may be a bit premature as this probably needs discussion first on > whether this is worth doing. Yes, there are common methods between the two > but at the same time, the byte and character hierarchies have always been > distinct.

Re: RFR: 8301220: Return value of toArray() of Сollection types from java.base should be trusted [v3]

2023-01-29 Thread Tingjun Yuan
On Mon, 30 Jan 2023 03:02:33 GMT, Glavo wrote: > > Why not use set of classes? > > Because some classes are not visible here (such as `Arrays.ArrayList`). > > I'm not sure what the best choice is, so I'm trying to explore the > implementation plan. Only `Arrays.ArrayList` is not visible

Re: RFR: 8301220: Return value of toArray() of Сollection types from java.base should be trusted [v3]

2023-01-29 Thread Tingjun Yuan
On Mon, 30 Jan 2023 02:55:24 GMT, Glavo wrote: >> I checked the `java.base` module, and all the `Collection#toArray()` method >> of collections be implemented correctly. >> >> Their return values can be trusted, so many unnecessary array duplication >> can be eliminated. > > Glavo has updated

Re: RFR: 8301043: Super-interface for PrintStream and PrintWriter [v2]

2023-01-29 Thread Tingjun Yuan
On Sun, 29 Jan 2023 07:11:26 GMT, Tingjun Yuan wrote: >> Add `java.io.PrintOutput` to represent print operations, and modify >> `java.io.PrintStream` and `java.io.PrintWriter` to implement it. > > Tingjun Yuan has updated the pull request incrementally with one addition

Re: RFR: 8301042: Need methods to check null elements in an array or a collection [v5]

2023-01-29 Thread Tingjun Yuan
messageSupplier) > public static > L requireNoNulls(L list, > IntFunction messageGenerator) > public static > L requireNoNullsElseReplace(L > list, IntFunction replaceFunction) Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revisio

Re: RFR: 8301043: Super-interface for PrintStream and PrintWriter [v2]

2023-01-28 Thread Tingjun Yuan
> Add `java.io.PrintOutput` to represent print operations, and modify > `java.io.PrintStream` and `java.io.PrintWriter` to implement it. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revision: Fix grammar mistakes in t

RFR: 8301043: Super-interface for PrintStream and PrintWriter

2023-01-28 Thread Tingjun Yuan
Add `java.io.PrintOutput` to represent print operations, and modify `java.io.PrintStream` and `java.io.PrintWriter` to implement it. - Commit messages: - remove `@since 1.5` - Make PrintWriter implement PrintOutput - Make PrintStream implement PrintOutput - Create

Re: RFR: 8301042: Need methods to check null elements in an array or a collection [v4]

2023-01-28 Thread Tingjun Yuan
> Supplier messageSupplier) > public static > M requireNoNulls(M map, Supplier > messageSupplier) > public static > L requireNoNulls(L list, > IntFunction messageGenerator) Tingjun Yuan has updated the pull request incrementally with two additional commits since the last revis

Re: RFR: 8301042: Need methods to check null elements in an array or a collection [v3]

2023-01-28 Thread Tingjun Yuan
> Supplier messageSupplier) > public static > M requireNoNulls(M map, Supplier > messageSupplier) > public static > L requireNoNulls(L list, > IntFunction messageGenerator) Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revision

Re: RFR: 8301042: Need methods to check null elements in an array or a collection [v2]

2023-01-28 Thread Tingjun Yuan
> Supplier messageSupplier) > public static > M requireNoNulls(M map, Supplier > messageSupplier) > public static > L requireNoNulls(L list, > IntFunction messageGenerator) Tingjun Yuan has updated the pull request incrementally with one additional commit since the last

RFR: 8301042: Need methods to check null elements in an array or a collection

2023-01-28 Thread Tingjun Yuan
Adding the following methods to check the nullity of elements of an array or a collection: java.util.Arrays: public static E[] requireNoNulls(E[] array) public static E[] requireNoNulls(E[] array, String message) public static E[] requireNoNulls(E[] array, IntFunction messageGenerator)

Re: RFR: 8301220: Return value of toArray() of Сollection types from java.base should be trusted

2023-01-27 Thread Tingjun Yuan
On Fri, 27 Jan 2023 12:15:34 GMT, Glavo wrote: > > What about Collections.synchronizedCollection and other methods that may > > wrap/delagete to collections from other modules? > > Good question, I missed this point. I think I should provide a helper method > to check whether the collection

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v7]

2023-01-22 Thread Tingjun Yuan
> Document `java.util.Arrays.asList` that the list will throw an > `ArrayStoreException` when attempting to set an element with a wrong type. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revision: Update `implSpec` and remove th

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v6]

2023-01-22 Thread Tingjun Yuan
> Document `java.util.Arrays.asList` that the list will throw an > `ArrayStoreException` when attempting to set an element with a wrong type. Tingjun Yuan has updated the pull request incrementally with two additional commits since the last revision: - Restore List.java - Fix whit

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v5]

2023-01-22 Thread Tingjun Yuan
> Modify `java.util.Arrays.ArrayList.{set,replaceAll}` to throw a > `ClassCastException` (as documented in `java.util.List`) when attempting to > set an element with a wrong type. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v4]

2023-01-22 Thread Tingjun Yuan
> Modify `java.util.Arrays.ArrayList.{set,replaceAll}` to throw a > `ClassCastException` (as documented in `java.util.List`) when attempting to > set an element with a wrong type. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last revisio

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException

2023-01-22 Thread Tingjun Yuan
On Mon, 23 Jan 2023 06:29:47 GMT, Stuart Marks wrote: > We don't want to change long-standing exception-throwing behavior for these > cases. See my comments in > [JDK-8296935](https://bugs.openjdk.org/browse/JDK-8296935). Understand that, so I restored the current behavior and documented

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v3]

2023-01-22 Thread Tingjun Yuan
> Modify `java.util.Arrays.ArrayList.{set,replaceAll}` to throw a > `ClassCastException` (as documented in `java.util.List`) when attempting to > set an element with a wrong type. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v2]

2023-01-22 Thread Tingjun Yuan
> Modify `java.util.Arrays.ArrayList.{set,replaceAll}` to throw a > `ClassCastException` (as documented in `java.util.List`) when attempting to > set an element with a wrong type. Tingjun Yuan has updated the pull request incrementally with one additional commit since the last

RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException

2023-01-22 Thread Tingjun Yuan
Modify `java.util.Arrays.ArrayList.{set,replaceAll}` to throw a `ClassCastException` (as documented in `java.util.List`) when attempting to set an element with a wrong type. - Commit messages: - Modify Arrays.java Changes: https://git.openjdk.org/jdk/pull/12135/files Webrev: