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.