Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.6-rc-2
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
The println behavior for strings in collections is confusing. There should be no exclamation mark in line 8 of the following script. It is particularly confusing, as the behavior is different for strings and gstrings.
import org.codehaus.groovy.runtime.InvokerHelper def g = 'g' def string = 'groovy' def gString = "${g}roovy" println string // groovy println gString // groovy println([string]) // ["groovy"] !!!!! This should be [groovy] println([string].toString()) // [groovy] System.out.println([string]) // [groovy] println([gString]) // [groovy] // The culprit assert '"groovy"' == InvokerHelper.format(string, true)
Issue Links
- is related to
-
GROOVY-2330
GString vs String equality in collections
-
-
GROOVY-2444
list of string output format changed between 1.5.0 and 1.5.1
-
-
GROOVY-2458
Differences between StringBuffer.append und String +
-