<Sound Dev> RFR: 8271603: Unnecessary Vector usage in java.desktop
serb at openjdk.java.net
Mon Aug 9 07:21:50 UTC 2021
On Mon, 5 Jul 2021 14:00:07 GMT, Сергей Цыпанов <github.com+10835776+stsypanov at openjdk.org> wrote:
>> Usage of thread-safe collection `Vector` is unnecessary. It's recommended to use `ArrayList` if a thread-safe implementation is not needed. In post-BiasedLocking times, this is gets worse, as every access is synchronized.
>> I checked only places where `Vector` was used as local variable.
> src/java.desktop/share/classes/javax/sound/sampled/AudioSystem.java line 244:
>> 242: }
>> 244: return list.toArray(new Line.Info[list.size()]);
> Shouldn't it be `new Line.Info` as in the class below?
It looks fine to change.
More information about the sound-dev