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

[lang] NPE in EqualsBuilder when field in multiarray == null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 34284

    Description

      The EqualsBuilder.append(Object[] lhs, Object[] rhs) gives a Nullpointer in
      cases of multi dimensional arrays with null fields when reflectEqual an object
      containing a 3D Object array.

      Fix:
      <...>
      for (int i = 0; i < lhs.length && isEquals; ++i) {
      // Fix when element is null
      if ( lhs[i] != null ) {
      Class lhsClass = lhs[i].getClass();
      if (!lhsClass.isInstance(rhs[i]))

      { isEquals = false; //If the types don't match, not equal break; }

      }
      append(lhs[i], rhs[i]);
      }
      <...>

      Attachments

        Activity

          People

            Unassigned Unassigned
            lemval@zonnet.nl Michael
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: