GenericData.toString() references the wrong variable, which causes it to generate invalid JSON if an unprintable character appears in a string field. This patch fixes it.
Don't generate invalid JSON for unprintable chars
This is a duplicate of AVRO-851. Thanks for alerting me that this issue had never been fixed. I just committed that patch.
In the future, please use https://issues.apache.org/jira/browse/AVRO to report bugs in Avro.
Thank you Doug!