Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.6-rc-1
-
Fix Version/s: 1.6-rc-2, 1.5.8, 1.7-beta-1
-
Component/s: groovy-jdk
-
Labels:None
-
Environment:Groovy 1.5.8, 1.6, trunk.
-
Number of attachments :
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.
Issue Links
- relates to
-
GROOVY-3246
There should be a DGM.normalize(String) method which acts like readLines().join('\n')
-
Activity
| Field | Original Value | New Value |
|---|---|---|
| Link |
This issue relates to |
| 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 ] |
Other than the names of the patch files pretend they're not for trunk but for the 1.6 branch.