Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.0-JSR-5
-
None
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 */