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

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

    XMLWordPrintable

Details

    • b14

    Backports

      Description

        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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: