Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0-beta-2
-
Labels:None
-
Number of attachments :
Description
There's some tests failing when a string looks like this "$
{foo}" or "${foo}text". See the test case src/test/groovy/GStringTest.groovy (uncomment the @todo)
When there is a GString with a value in the first position the elegant logic of the toString method breaks down because in order to preserve its simplicity, there must be a string not a value as the first thing in the GString. This change simply checks to see if there are no strings when adding a value, if there are not, then it puts an EMPTY_STRING as the first thing in the string list. This preserves the way toString is handled, is unobtrusive, and fixes the bugs that were commented out.