Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure all keywords are stringified by java-util-hashmappify-vals (#68)
* Ensure all keywords are stringified by java-util-hashmappify-vals Change java-util-hashmappify-vals to also change keywords to strings for lone values nested under a map's direct values. When postwalk would encounter a non-map value, the value would be returned as-is. This means a keyword which would be nested inside another non-map structure would not be converted to a string. For maps, if the keys or values are keywords themselves, it would always directly convert them into strings, which masked the problem. This results in weird-looking serialization which exposes the underlying Java Keyword object, as per #67. * Simplify java-util-hashmappify-vals function Instead of doing the map? test twice, do it once, using postwalk. Postwalk already traverses all objects depth-first, so there's no need to test for map? again in the inner "f" function. To preserve existing functionality, use walk on the outer map (or whatever object) to prevent it from being converted to a HashMap. Add a test for the class of the resulting value and nested values to ensure the functionality is still as before.
- Loading branch information