<AWT Dev> RFR: 8263530: sun.awt.X11.ListHelper.removeAll() should use clear()
Sergey Bylokhov
serb at openjdk.java.net
Fri Mar 12 22:20:06 UTC 2021
On Fri, 12 Mar 2021 15:44:39 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> SonarCloud reports:
> Remove or correct this "removeAll" call.
>
> void removeAll() {
> items.removeAll(items); // <--- here
> updateScrollbars();
> }
>
> Calling `removeAll()` with the same collection risks concurrent modification exceptions. `clear()` would be correct and more efficient.
It will be good to update the year in Copyright as well.
-------------
Marked as reviewed by serb (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/2974
More information about the awt-dev
mailing list