Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-838

ArrayUtils removeElements methods clone temporary index arrays unnecessarily

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1
    • 3.2
    • lang.*
    • None

    Description

      The private method removeAll(Object array, int... indices) sorts the indices array, so arrays passed in by application code need to be cloned first.

      However, where the index array is generated locally, that is unnecessary.

      The removeElements() methods currently call the public removeAll(<type>[] array, int... indices) methods, which clone the indices before calling the private removeAll() method.

      The removeElements() methods should call the private method directly, avoiding the unnecessary clone call.

      Attachments

        Activity

          People

            sebb Sebb
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: