GateNLP / gate-core

The GATE Embedded core API and GATE Developer application
GNU Lesser General Public License v3.0
75 stars 29 forks source link

Plugin upgrade utility should not convert the pipeline file to dos on linux #76

Closed johann-petrak closed 5 years ago

johann-petrak commented 5 years ago

The utility currently changes a file with linux-style line endings to dos format even on a linux machine.

Ideally this should retain the line-endings style of the input file, or create line endings as appropriate for the OS.

greenwoodma commented 5 years ago

I'm sure we've discussed this before and there was a reason it worked the way it did. Can't now remember what it was though

ianroberts commented 5 years ago

It's to do with the fact that JDOM has a different default from XStream - I did originally make a change to have the upgrader use LF rather than CRLF when pretty printing (68b48263fe4dc301d4d5883485223763a99cc81f) but then subsequently changed my mind and didn't have JDOM do any pretty printing at all (8b89090f10791274b7a2b784503288ed90a64ce2) because it messed up cases where whitespace is significant (e.g. a gazetteerFeatureSeparator set to a literal tab character rather than an escaped \t). What I hadn't realised at the time was that even JDOM's "raw" formatter by default switches all newlines to CRLF...

greenwoodma commented 5 years ago

Ah that was it, now I remember about it messing up the gazetteerFeatureSeparator. Other than it being confusing for source control the line endings don't really matter much, so it's not a huge problem.