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. ------------- Commit messages: - 8263530: sun.awt.X11.ListHelper.removeAll() should use clear() Changes: https://git.openjdk.java.net/jdk/pull/2974/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2974&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263530 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/2974.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2974/head:pull/2974 PR: https://git.openjdk.java.net/jdk/pull/2974