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

[lang] [patch] EqualsBuilder.append(Object[], Object[]) throws NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.1
    • None
    • None
    • Operating System: other
      Platform: Other

    • 23174

    Description

      Hi,

      if you append array's which contains null values to an EqualsBuilder instance,
      a NPE is thrown. This causes troubles in the ArrayUtils.isEquals(Object[],
      Object[]) method as well because it uses the EqualsBuilder class.

      To duplicate: execute this code:

      Object[] array1 = new Object[]

      {"1", null, "2"};
      Object[] array2 = new Object[] {"1", null, "2"}

      ;
      new EqualsBuilder().append(array1, array2).isEquals();

      and you'll get this Exception:

      java.lang.NullPointerException
      at org.apache.commons.lang.builder.EqualsBuilder.append(EqualsBuilder.java:513)

      kind regards,
      Maarten Coene

      Attachments

        Activity

          People

            Unassigned Unassigned
            maartenc Maarten Coene
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: