Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8263530

sun.awt.X11.ListHelper.removeAll() should use clear()

XMLWordPrintable

    • b14

        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.

              shade Aleksey Shipilev
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: