-
Notifications
You must be signed in to change notification settings - Fork 118
Code Styles
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...
[JDOM Home](http://www.jdom.org)
Stable Release
- [Download](http://www.jdom.org/downloads/index.html)
- [JavaDoc](http://www.jdom.org/docs/apidocs/index.html)
JDOM 2.x
- Overview
- Getting Started
- JDOM on Android
- [JavaDoc](http://hunterhacker.github.com/jdom/jdom2/apidocs/index.html)
- [Coverage](http://hunterhacker.github.com/jdom/jdom2/coverage/index.html)
- [UnitTests](http://hunterhacker.github.com/jdom/jdom2/junit.report/index.html)
- Features
- JDOM 1.x to JDOM 2.x
- Dependencies
Developing JDOM