Empty primitive vectors throw NPE on .equals with non-vector sequential types

Description

Primitive vectors have several equality cases. In the case where the compared value is not a vector or random access collection but is a sequential or list, an empty primitive vector will throw an NPE:

Cause: In this case of the primitive vector equals() method, seq is called on itself, then .equals() is invoked on the result. seq will return null for an empty primitive vector, causing an NPE.

Solution: Check for this condition and compare with (nil? (seq o)) on the other object.

Patch: CLJ-1339.patch

Environment

None

Attachments

1

Activity

Show:
Completed

Details

Assignee

Reporter

Approval

Ok

Patch

Code and Test

Priority

Affects versions

Fix versions

Created February 4, 2014 at 10:11 PM
Updated February 14, 2014 at 4:18 PM
Resolved February 14, 2014 at 4:18 PM