With a team of developers, they should all use the same code formatting rules.
In Eclipse, we can define the code formatting rules, export them and store them
in Subversion. Then all developers can import these. From what I can see, the
following features are missing in NetBeans (compared to Eclipse):
1. Allow one to do "Format Code" in the project navigator (i.e. on a package or
an entire project, not just inside a single Java file)
2. Extend the code formatting rules (Eclipse provides A LOT more control over
the formatted code)
3. Allow import/export of code formatting rules
It seems like a lot of this (at least #2 and #3) can be handled by the Jalopy
However, with Eclipse it comes for free... :-)
Right now the only thing preventing me from introducing netbeans in an eclipse env at a very large financial firm is
code formatting. The reason this is a big issue - if we do not manage to get netbeans to format like eclipse, the
clearcase will start showing differences due to formatting all over the place and the actual change would become very
difficult to find, so this is absolutely essential if you want netbeans and eclipse to co-exist in any real world
project, people might now say it explicitly but this would be showstopper. I have been trying to change eclipse rules
and netbeans rules to match but the biggest stumbling block is the weird feature you guys have added in 6.0 where code
formatting will completely ignore line breaks. Eclipse has this cool feature that if your code line get longer than a
predefined limit (say 135 ) then it will break it into multiple lines. But netbeans will make it one long line again.
You can contact me directly for more details - firstname.lastname@example.org
The reason I changed it to a P1 - if you could just introduce a new flag so netbeans will not ignore line breaks or get
netbeans to split a line when it goes longer than a certain limit it will atleast be possible for netbeans and eclipse
to co-exist otherwise it is a deal breaker.
There new formatting setting introduced in 6.0, including the line wrap options. See Options->Java Code-> Formatting
The latest daily build should also respect line breaks.
Other features requested in this issue are unfortunately not implemented yet and won't be included in 6.0, since the 6.0
is feature frozen now.
will this issue be considered for the next version of Netbeans? (6.2?)
(In reply to hbjastad from comment #0)
> With a team of developers, they should all use the same code formatting
> In Eclipse, we can define the code formatting rules, export them and store
Dup of #197876
*** This bug has been marked as a duplicate of bug 197876 ***