Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6-rc-1
-
None
-
Groovy 1.5.8, 1.6, trunk.
Description
DGM#denormalize, in contrast to DGM#normalize, does not handle Mac style line breaks correctly. It throws an IndexOutOfBoundsException with empty strings.
Attached a patch that solves this. It does not need an import of PlatformLineWriter and throws no IOException anymore.
The patch also contains an alternative implementation of DGM#normalize it has speedup factors of 0.66 to 8 compared with the current implementation. However I don't know if it would have any practical worth to replace the current implementation.
The second patch adds tests to DefaultGroovyMethodsTest.
Additionally, I would like to discuss if DGM#normalize should really remove the last trailing linefeed.
Attachments
Attachments
Issue Links
- relates to
-
GROOVY-3246 There should be a DGM.normalize(String) method which acts like readLines().join('\n')
- Closed