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

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

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b14

      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

              Assignee:
              shade Aleksey Shipilev
              Reporter:
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: