RFR: 8193031: Collections.addAll is likely to perform worse than Collection.addAll
Guoxiong Li
github.com+13688759+lgxbslgx at openjdk.java.net
Sat Dec 19 09:12:57 UTC 2020
On Thu, 17 Dec 2020 10:36:17 GMT, Rémi Forax <github.com+828220+forax at openjdk.org> wrote:
>> Looks like I've found the original ticket: https://bugs.openjdk.java.net/browse/JDK-8193031
>
> Apart from the @SuppressWarnings, this looks good to me.
> And i like the irony of this.
Hi all,
According to the document of [SafeVarargs](https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/SafeVarargs.html).
> Compilers are encouraged to issue warnings when this annotation type is applied to a method or constructor declaration where:
> The body of the method or constructor declaration performs potentially unsafe operations, such as an assignment to an element of the variable arity parameter's array that generates an unchecked warning.
The `SafeVarargs` may not suppress the warning of this assignment and the `SuppressWarnings` may be necessary.
If you still think it is the bug of compiler. I suggest that you move the bug discussion to the compiler-dev at openjdk.java.net to solve the bug as soon as possible.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1764
More information about the core-libs-dev
mailing list