Closed techsy730 closed 3 years ago
Hey, toArray() with a primitive-type array argument is deprecated upstream. I really think you have warnings disabled for deprecated methods, or you should see this. My suggestion is that of not implementing it at all (the docs say it will be removed in a future release).
Oops, I thought I overrode the right primitive toArray. I guess not.
And yep, "Signal overriding or implementing deprecated method" was unchecked for me. Oops
Yeah, probably we will get rid of it in 9.0.0. One day.
Actually, it is methods like toIntArray(int[])
that are deprecated. It says toArray(int[])
is the preferred one.
In Collection.drv
/** Returns a primitive type array containing the items of this collection.
* [...]
* @deprecated Please use {@code toArray()} instead—this method is redundant and will be removed in the future.
*/
@Deprecated
default KEY_TYPE[] TO_KEY_ARRAY(KEY_TYPE a[]) {
return toArray(a);
}
/** Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.
* [...]
*/
KEY_TYPE[] toArray(KEY_TYPE a[]);
Oops, I remembered incorrectly. Well, at least now you have the warning on :).
Add a fast
toArray
toArraySet
Also slightly expand the unit tests for object based
toArray
s