Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.0-JSR-5
-
Fix Version/s: 1.0-JSR-6
-
Component/s: groovy-jdk
-
Labels:None
-
Number of attachments :
Description
the GDK methode join() on arrays is defined as join(java.lang.String separator):
assert ['a', 'b'].join('-') == 'a-b'
If the separator is missing, groovy doesn't fail (good!), but it sets the separator to null.
assert ['a', 'b'].join() == 'anullb'
A sensible default should be provided, either an empty string (as in ruby), or a single blank, so that:
assert ['a', 'b'].join() != 'anullb'
assert ['a', 'b'].join() == 'ab' /* ruby-like */
assert ['a', 'b'].join() == 'a b' /* own-convention */
"" as been set as the default value. CVS updated