forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Crossley <>
Subject Re: Automated formatting of Java files
Date Fri, 26 Aug 2005 06:53:10 GMT
Diwaker Gupta wrote:
> Following up with our earlier discussion on whitespace cleanup, I have added 
> two "jalopied" Java source files in the test-whitespace directory. I would 
> urge the devs to take a look at both the original Java file and the formatted 
> file and see if it suits their tastes.
> Please post any comments and suggestions in this thread. Bear in mind that 
> with Jalopy, almost *anything* is configurable. So if you find anything, 
> however small/trivial it is that you don't like, please let me know. Its a 
> great tool, so lets make the best use of it. 

I think that it is doing too much, e.g. aligning like this:
         this.processor     = null;
         this.parser        = null;

We should start with very simple stuff, e.g. just tabs
and trailing whitespace, then gradually add other operations.
However we don't want to get too strict on code style.

I suggest that we define a list of what we would possibly
want to adrress. Here is a start:

1 whitespace at end-of-line
2 tabs to four-space
3 indentation
4 organise imports
5 whitespace in java statements
6 aligned variable assignments

We need to at least do 1 and 2 while 5 and 6
may be doubtful.


> To see exactly what is configurable, take a look at:
> As an example of things that it can do:
> o automatically add/update headers (the Apache license, for instance. In 
> future if we have to change one line in the license, Jalopy will 
> automatically delete the old one and insert the new one)
> o sorting/group of imports, methods, variables
> o alignments, braces, spaces -- you name it!
> o automatic javadoc generation, correction
> -- 
> Web/Blog/Gallery:

View raw message