You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/04/04 13:18:27 UTC

DO NOT REPLY [Bug 34284] New: - Nullpointer in Equalsbuilder when field in multiarray == null.

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34284>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34284

           Summary: Nullpointer in Equalsbuilder when field in multiarray ==
                    null.
           Product: Commons
           Version: 2.0 Final
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Lang
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: lemval@zonnet.nl


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]);
        }
        <...>

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org