RFR: 8193031: Collections.addAll is likely to perform worse than Collection.addAll [v2]
Сергей Цыпанов
github.com+10835776+stsypanov at openjdk.java.net
Thu Dec 17 11:06:56 UTC 2020
On Thu, 17 Dec 2020 10:50:01 GMT, Rémi Forax <github.com+828220+forax at openjdk.org> wrote:
>> Hi, without this I get failed build:
>> Compiling 3057 files for java.base
>> Compiling 89 properties into resource bundles for java.desktop
>>
>> return c.addAll(Arrays.asList(elements));
>> ^
>> error: warnings found and -Werror specified
>> 1 error
>> 1 warning
>> make[3]: *** [/home/s.tsypanov/IdeaProjects/jdk-github/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_batch] Error 1
>> CompileJavaModules.gmk:604: recipe for target '/home/s.tsypanov/IdeaProjects/jdk-github/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_batch' failed
>> make[2]: *** [java.base-java] Error 2
>> make[2]: *** Waiting for unfinished jobs....
>> make/Main.gmk:193: recipe for target 'java.base-java' failed
>
> ok, it means there is a bug in the compiler, the analysis done for unsafe varargs (with -Xlint:varargs) doesn't check that the called method (here Arrays.asList()) is tagged with @SafeVarargs.
Should I then wait for the fix of that bug to remove `@SupressWarnings`?
-------------
PR: https://git.openjdk.java.net/jdk/pull/1764
More information about the core-libs-dev
mailing list