0

I used Tortoise SVN to checkout the code from http://code.google.com/p/osmdroid/source/checkout then added it as Java source attachment for the osmdroid-android-1.08.jar. Now when I tried to step through the source I noticed that the debugger jumped to the wrong lines. Turns out my .java files have additional linebreaks in them. As if I used ctrl-shift-f in Eclipse. SVN says there are no differences in my working copy but when I browse the source online on google code those linebreaks are not there.

How can I fix this? Or what did I do wrong?

boston
  • 355
  • 1
  • 4
  • 7

2 Answers2

0

Line breaks are interpreted differently on Unix/Linux and on Windows.

The SVN diff ignores the line breaks and therefore it doesn't see the change, but your IDE probably uses the standard OS interpretation. You should be able to change it in the properties of the project or preferences for eclipse (I am not completely sure where since I am not currently using eclipse)

Jes
  • 2,748
  • 18
  • 22
0

Probably a case of different newlines \n (linux) and \r\n (windows)?

But to alter your eclipse settings VonC has put it much better (check related SO answer here).

Edit:

Stolen from VonC:

Note: to convert the line endings of an existing file, open the file in Eclipse and choose File : Convert Line Delimiters to : Unix

Tip: You can easily convert existing file by selecting then in the Package Explorer, and then going to the menu entry File : Convert Line Delimiters to : Unix

Community
  • 1
  • 1
Frankie
  • 24,627
  • 10
  • 79
  • 121
  • Ok I followed that answer. Changed Text file encoding to UTF-8 and line delimeter to UNIX. The line breaks are still there. I deleted the source files and checked them out again. Still there. Notepad++ shows the linebreaks too. – boston Dec 13 '10 at 11:30
  • @boston updated answer to the relevant part about *changing* line breaks on existing files. From your comment I would say you were changing the behavior on NEW files and not on CURRENT files. – Frankie Dec 13 '10 at 11:49
  • @Frankie. I did that too. Linebreaks stay :( – boston Dec 13 '10 at 13:46
  • @boston don't know how to help you anymore. The problem is, width a high level of confidence, related to the way systems treat newlines. Check the files with VIM and Notepad++, for example. From here you'll have to manage yourself as it is a very personal-system-related issue. – Frankie Dec 13 '10 at 13:53
  • Oh my bad. There was a new .jar out since 5 days. Updated and everything is fine now. Thanks anyway! – boston Dec 13 '10 at 14:48
  • @boston ahhh! Happy feeling! ;) Cheers. – Frankie Dec 13 '10 at 14:51