On 2010-03-29, at 10:07, P T Withington wrote:

> On 2010-03-28, at 20:53, André Bargull wrote:
> 
>> Ok, here's what's going on. From 
>> "org.openlaszlo.js2doc.Comment.extractJS2DocComment (String)":
>>>       String cr = System.getProperty("line.separator");
>>> 
>>>       Comment parsedComment = new Comment();
>>> 
>>>       if (sourceComment != null) {
>>>           String content = 
>>> contentsPattern.matcher(sourceComment).replaceAll("$1");
>>> 
>>>           String[] lines = content.split(cr);
>> 
>> 
>> 
>> That's obviously wrong. On a Windows machine the separator is \r\n, but all 
>> line endings in the files are just \n, so no lines will be split! I'm going 
>> to change that..
> 
> Hm...
> 
> Our source code is supposed to be text and _should_ have platform 
> line-endings when checked out via svn.
> 
> See:  "How to I ensure that eol style will be mapped to native format when I 
> checkout/checkin?" at (http://wiki.openlaszlo.org/SubversionTips).
> 
> But when using Windows, there are the added twists of what the platform 
> line-ending is in Cygwin (if you are using that) and what Java thinks the 
> platform ending is (which I believe has its own twist because you install it 
> under Windows and then might call it from Windows _or_ Cygwin).  [Curse you 
> Bill Gates for ripping off Gary Kildall so faithfully!]

[Later}

Probably the simplest solution is to use a pattern to split and accept either 
LF or CR/LF, rather than try to figure out the Java/Cygwin/Windows stack.  You 
could even say you were just being XHTML-compliant.  :P


Reply via email to