On 30/01/2023 3:37 am, Glavo wrote:
I quite agree with you. I think the collection framework is in a very
puzzling state.
The hostility of the new collection factory method introduced by Java 9
to null has brought us trouble.
I can understand that this is to expect users to explicitly decla
On 26/01/2023 7:49 pm, Tagir Valeev wrote:
Hello!
Not sure if this should be considered as a problem that requires
attention but there's an initialization loop between
There are probably still quite a number of "initialization loops" in the
core libraries. But they can only trigger if you exp
On Wed, 18 Jan 2023 08:58:42 GMT, Xiaohong Gong wrote:
> The Vector API `"indexInRange(int offset, int limit)"` is used
> to compute a vector mask whose lanes are set to true if the
> index of the lane is inside the range specified by the `"offset"`
> and `"limit"` arguments, otherwise the lanes
On Mon, 30 Jan 2023 03:09:53 GMT, Tingjun Yuan 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.
>
>> > Why not use set of classe
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 here.
On Sun, 29 Jan 2023 16:07:08 GMT, Peter Levart wrote:
>> Christian Wimmer has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> Add comment about method inlining
>
> Hi Christian, I can sponsor to pull this change if you like.
@plevart yes p
On Mon, 30 Jan 2023 02:57:52 GMT, Tingjun Yuan 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.
-
PR: https://git.openjdk.org/jdk/p
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
> 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 the pull request incrementally with one additional commit
On Sat, 28 Jan 2023 19:54:32 GMT, Glavo wrote:
>> This is the javadoc of `JavaLangAccess::newStringNoRepl`:
>>
>>
>> /**
>> * Constructs a new {@code String} by decoding the specified subarray of
>> * bytes using the specified {@linkplain java.nio.charset.Charset
>> charset}.
>>
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 additional
> commit since the las
On Sun, 29 Jan 2023 10:39:22 GMT, Tingjun Yuan wrote:
>> 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)
>> p
I quite agree with you. I think the collection framework is in a very
puzzling state.
The hostility of the new collection factory method introduced by Java 9 to
null has brought us trouble.
I can understand that this is to expect users to explicitly declare that
the elements of the list cannot be
I tend to agree.
Presumably it is similar reasoning that led to Collection.contains() to take
Object rather than E.
> On Jan 29, 2023, at 7:28 AM, John Hendrikx wrote:
>
> TLDR; why does contains(null) not just return false for collections that
> don't allow nulls. Just because the interface
On Mon, 9 Jan 2023 20:04:34 GMT, Christian Wimmer wrote:
>> The method `String.split` contains a fast-path when the regular expression
>> parameter is not really a regular expression, but just a single split
>> character.
>> This fast path vs. slow path check can be constant folded when the reg
TLDR; why does contains(null) not just return false for collections that
don't allow nulls. Just because the interface allows it, does not mean
it should do it as it devalues the usefulness of the abstraction
provided by the interface.
Background:
I'm someone that likes to check correctness o
> 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
> messa
17 matches
Mail list logo