Just now I wanted to compare a couple of arrays in Coldfusion to ensure they were both exactly the same. I knew that CFCUnit had this functionality and I had even pottered through the code a while back to see how it was done and had noticed that it was doing actual.equals(expected) or something like that, where both actual and expected are the arrays to compare.

I’d found this interesting first time round but didn’t think much more about it until now. So with my current task in hand I headed back to CFCUnit to make sure my eyes hadn’t deceived me and had another look; yes that is what is was doing and no there wasn’t any voodoo involved.

It hadn’t really occurred to me until that moment - and I’m not sure if I’ve ever read anything about this, but data types in Coldfusion extend Java data types; in the case of arrays that is java.util.Vectors.

This gives us access to all the native methods that Java has available on those data types and for my requirement that meant the nice and simple way to ensure that two (Coldfusion) arrays arrayA.equals(arrayB) are the same.