Miscellaneous

Only format Javadoc comments

When enabled, only Javadoc comments are formatted according to the current Javadoc settings. Any surrounding source code is left untouched. When you enable this option, the GUI switches its mode and hides all non-Javadoc related options. In order to display the full set of options again, you have to disable the Javadoc-only option. You can control the style of Javadoc comments through the Javadoc settings pages.

Since 1.8

Array brackets after identifier

Lets you choose where the brackets of array types should be placed. By default, Jalopy prints the square brackets right after the array type.

Example 2.26. Array brackets after type

int[] a;

But C/C++ programmers may expect them to appear after the identifier instead.

Example 2.27. Array brackets after identifier

int a[];

Note that Java allows some strange freedom in the way arrays can be defined. Array brackets may not only appear after either the type or an identifier, but a mixed style is also allowed (though not recommended). Jalopy handles all styles well, but is only able to move the brackets if the dimension of all array declarators is equal.

Example 2.28. Mixed array notation with equal dimensions

float[] f[][], g[][], h[][];

Jalopy would print the above example as

Example 2.29. Mixed array notation with equal dimensions after formatting

float[][][] f, g, h;             // print brackets after type

float f[][][], g[][][], h[][][]; // print brackets after identifier

Mixed array declarators with different dimensions will be printed as-is.

Example 2.30. Mixed array notation with different dimensions

float[][] f[][], g[][][], h[];

Split multi-variables

When enabled, multi-variables are split into several variable declarations. Otherwise multi-variables are kept and printed according to the current settings.

Since 1.0.1

Example 2.31. Multi-variable

BigInteger q = null, p = null, g = null;

Example 2.32. Splitted multi-variable

BigInteger q = null;
BigInteger p = null;
BigInteger g = null;

Remove redundant modifiers

The Java Language specification allows certain modifiers that are redundant and should be avoided. Enabling this option will ensure that these modifiers are removed where present. The modifiers that will be removed are:

Since 1.5