On Thu, 7 May 2026 06:45:36 GMT, Per Minborg <[email protected]> wrote:

> This PR proposes to add a new `default` method `List::removeAtIndex`.
> 
> There are two overloads of the method `List::remove`, and if the list is of 
> type `List<Integer>`, the overload resolution could pick a surprising variant.
> 
> Hence, it is better to add a separate method that removes an element based on 
> its index.
> 
> It is proposed that the `E remove(int index)` method is _not_ `@Deprecated`. 
> Instead, we add verbiage to promote the new method over the old one.
> 
> ---------
> - [X] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

I'll admit I'm a bit ambivalent about adding this (not that it is in any way my 
decision), and being forced to use the name `removeAtIndex` makes it worse for 
me, because then we're polluting precedent. Per, how bad would the damage 
really be from using the good name?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/31064#issuecomment-4423716708

Reply via email to