douglascrockford/JSON-java — pull request #84 by mtanana (2013-06-26 05:56:22+00:00)
Title: Force an array using accumulate (even if there is only one item)

I don't know if anyone wants this (or whether it violates JSON standards) but I've found that when I use JSONObject.accumulate I want to force an array object. This saves from having to write checking code on the client side to see if the item is an object or an array. You can just iterate over it the same way (because sometimes collections only have one item).

If there is a better way to handle this, please let me know.

In any case, this mod does it, but I suspect this function may have been written this way on purpose. Anyway, I love and depend on this library so thanks for keeping it maintained.