These are the cxf and camel formatters:
https://github.com/apache/cxf/tree/master/etc/eclipse
https://github.com/apache/camel/tree/master/etc/eclipse

I have not checked the camel ones in details. They might be similar or the same as the cxf ones.

There are some things I do not like for the cxf formatting though:
- The import order is not the default and will be enforced by the build. So organizing imports with Ctrl-Shift-O messes up the order unless you have I think the cleanup rules installed. I think there is not good reason to not use the default order.
- I do not like the indent rules for parameters like
public void myMethod(String first,
                     String second) {
    someCode(first,
             second);
}
- The parameters are often very far to the right if you use long method names.
- Each method has a different indent for the parameters.
- When you change a method name the indent is changed.

I would prefer something like this below but have not yet seen such a formatter rule.
public void myMethod(
    String first, String second)
{
    someCode(
        first, second);

    alternatively(
        first,
        second);
}

This is discussed in a presentation by Kevlin Henney https://vimeo.com/97329157 (See from minute 24). Basically the idea is that there should be as few levels of indent as possible and the indent should not change when e.g. a method name is changed.

Christian

On 08.07.2015 12:37, Jeremy Hughes wrote:
Can you provide a link to the CXF / Camel source formatter files?



--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com

Reply via email to