gcj vs classpath merge status

Etienne M. Gagnon etienne.gagnon@uqam.ca
Tue Jan 29 11:48:00 GMT 2002


Brian Jones wrote:
> You should keep the reformatting separate from a code change if at all
> possible just so it is more clear in looking at CVS with diff/logs.
>> Is there a mode in standard GNU indent which meets the right
> formatting criteria for Java code and GNU standards?

GNU indent doesn't handle Java well, unfortunately (at least, the last time I 
checked). But I have discovered "astyle" 
http://www.bigfoot.com/~davidsont/astyle which works relatively well. It has 
supports the GNU style.
Personally, I use the following options, which give preety good results 
(relatively conform to the GNU style):
astyle -jbs2
It has a small glitch; it sometimes adds spurious blank lines, so applying 
astyle to a file repeatedly adds a block of empty lines. These lines are easily 
removed by a small program which removes blocks of empty lines [I have written one].
Astyle does't go as far as GNU indent for controling the indentation of code 
"within" a line of code (e.g. space before parentheses, etc.). But it is much 
better than nothing!
Etienne
-- 
Etienne M. Gagnon http://www.info.uqam.ca/~egagnon/
SableVM: http://www.sablevm.org/
SableCC: http://www.sablecc.org/


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /