groovy/groovy-core — pull request #113 by catalan42 (2013-01-18 04:26:07+00:00)
Title: Fix a bug in JsonBuilder.toPrettyString() for zero-length strings.

Zero-length strings are represented in JSON as a pair of double-quotes
(e.g. ""). This is actually a java.lang.String of length=2. The old
logic attempted to strip the leading & trailing quotes (either single or
double) using a range of (1..-2), which fails for length=2 strings (it
just reverses the 2 chars). Replaced with a call to
String.substring( 1, size()-1 ).

Fixes issues in both [GROOVY-5927](http://jira.codehaus.org/browse/GROOVY-5927) and [GROOVY-5733](http://jira.codehaus.org/browse/GROOVY-5733)