mikebrock/mvel — pull request #29 by newoga (2014-07-03 21:11:56+00:00)
Title: Maintain order when using inline maps and lists

First of all, awesome tool. I just recently starting messing around with MVEL.

I sent an email to the user mailing list this morning regarding the possibility of switching the parser's Map implementation from HashMap to LinkedHashMap so that the order of keys are maintained based on insertion.

My primary use case of having keys ordered based on insertion was using MVEL expressions to build maps that would be used for JSON parser for a REST API. I prefer when the JSON keys are ordered in a predictable way, and are consistent with API documentation.

This pull request has what I think are the necessary changes, and it includes a test that confirms the order works (test would break if HashMap implementation was kept).