Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.7-beta-1
-
None
Description
http://groovy.codehaus.org/groovy-jdk/java/lang/String.html#splitEachLine%28java.lang.String%20sep,%20groovy.lang.Closure%20closure%29
javadoc string says:
"Iterates through the given String line by line, splitting each line using the given separator. The list of tokens for each line is then passed to the given closure."
This is flat wrong, it splits the string using a regex match using the argument as a regular expression pattern. Its a major bug because it is bad documentation (as the old saying goes, is worse than no documentation), and it cost me an hour or two.
The argument should be called regex, not sep, because it is a regular expression, NOT a separator as tokenize uses.
This is related to GROOVY-3694, but I think this deserves its own bug because it is a separate issue.
Attachments
Issue Links
- is related to
-
GROOVY-3694 Consistent parameter names for DGM regex methods
- Closed