commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 34284] New: - Nullpointer in Equalsbuilder when field in multiarray == null.
Date Mon, 04 Apr 2005 11:18:27 GMT
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


Mime
View raw message