Skip to content
rolfl edited this page Sep 10, 2011 · 4 revisions

Yes, yes, yes. Eveyone loves code styles.

Right, the current issue is that I have been writing code in eclipse, in Windows, and in a few places I have inadvertantly changed the existing unix-style LF line terminators to DOS/Windows style CRLF.

Additionally, all new files have been created with CRLF terminators.

This has made the commit diff's hard to read, etc. (see for example https://github.com/hunterhacker/jdom/commit/8b5af879d2bdc4f7ac8d86caa8881d82bffc453f ). It is poor practice to change terminators.

The vast majority of JDOM is simple LF, and it makes sense to keep it that way. In commit https://github.com/hunterhacker/jdom/commit/8f8e6648765894fc0c2c7ed3c6c83ab24722ad23 I have repaired the mess of linefeeds I made.

   TO PREVENT THIS HAPPENING AGAIN (at least from eclipse)
   Change your preferences in Eclipse: Window -> Preferences
   Choose the page: General->Workspace
   Set (at the bottom)
   Text File Encoding ->  "Other" US-ASCII
   New Textfile Line Delimiter -> "Other" Unix

Other observations:

JDOM uses a line-length of 80 characters.

This limit is fairly rigorously applied to the core code, but more relaxed in the test and contrib folders.

I have been lax about adhering to that standard when writing the jUnit tests. But, it may be worth re-strcuturing the unit test files to conform. My screen is large enough though, that, even when in a smallish panel in eclipse, there is at least screen-space for 120 characters... 80 seems too limiting, especially when you start using generics...

Clone this wiki locally