Commons Lang
  1. Commons Lang
  2. LANG-256

[lang] add remove methods to ArrayUtils

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      Hi,

      I need remove methods for arrays. More in specific, I could use the following
      methods on ArrayUtils:

      Object[] remove(Object[] array, int index);
      Object[] removeElement(Object[] array, Object element);

      and the same for some primitive types...

      I'll attach a patch for ArrayUtils and a junit test. It would be great if this
      could be added to ArrayUtils.

      thanks,
      Maarten

        Activity

        Hide
        Maarten Coene added a comment -

        Created an attachment (id=10855)
        patch for ArrayUtils

        Show
        Maarten Coene added a comment - Created an attachment (id=10855) patch for ArrayUtils
        Hide
        Maarten Coene added a comment -

        Created an attachment (id=10856)
        junit test for the remove and removeElement methods

        Show
        Maarten Coene added a comment - Created an attachment (id=10856) junit test for the remove and removeElement methods
        Hide
        Maarten Coene added a comment -

        I did place the ArrayUtils.removeElement(char[] array, char element) in comment,
        because there is no ArrayUtils.indexOf(char[] array, char value) method. Is
        there a reason for this ?

        Show
        Maarten Coene added a comment - I did place the ArrayUtils.removeElement(char[] array, char element) in comment, because there is no ArrayUtils.indexOf(char[] array, char value) method. Is there a reason for this ?
        Hide
        Henri Yandell added a comment -

        Applied, uncommented the char[] part and added an indexOf for char[].

        Show
        Henri Yandell added a comment - Applied, uncommented the char[] part and added an indexOf for char[].
        Hide
        Henri Yandell added a comment -

        2.1 released, closing.

        Show
        Henri Yandell added a comment - 2.1 released, closing.

          People

          • Assignee:
            Unassigned
            Reporter:
            Maarten Coene
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development