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.
|Status||Open [ 1 ]||Resolved [ 5 ]|
|Resolution||Fixed [ 1 ]|
|Fix Version/s||1.5.8 [ 14630 ]|
|Fix Version/s||1.7-beta-1 [ 14014 ]|
|Fix Version/s||1.6 [ 13832 ]|
|Status||Resolved [ 5 ]||Closed [ 6 ]|