[Skip to content]

2.8.8. Indentation

Controls the indentation settings. Indentation is core to readability and describes the way white space is used to emphasize the logical structure of a program—logically subordinated elements are printed with increased indentation.

2.8.8.1. General

Lets you change the general indentation settings.

Figure 2.41. Indentation settings page

Indentation settings page

2.8.8.1.1. Strategies

Lets you choose the general strategy how lines should be indented. Jalopy supports several indentation strategies with different characteristics. You can even use different strategies for different elements, if you can’t decide on one global policy.

Changing the general indentation strategy in the tree widget will adjust all subordinated elements that are configured to use the prior general indentation strategy as well.

Standard

With standard indentation, lines will be always indented according to the current indentation level. The indentation level changes as the block or parentheses level changes. Standard indentation gives you great consistency: Because indentation always uses the same sizes (multiples of the defined “Indent size”), source code is very uniformly layed out and the white space gaps tend to be small.

When standard indentation is enabled, line wrapping will always try to keep lines within the maximal line length.

Example 2.260. Method declaration

public void severalParameters(String one, int two,
    String three, StringObject four, AnotherObject five)
{
}

Example 2.261. Method call

vector.add(new AppServer(
        "RemoteApplicationManager",
        poa.create_reference_with_id(
            "RemoteApplicationManager".getBytes(),
            RemoteApplicationManager.id())));

Example 2.262. Assignment

doublette[PflegeController.GEBURTSDATUM] =
    resultSetRow[i].field[0].substring(0, 2) + "." +
    resultSetRow[i].field[0].substring(2, 4) + "." +
    resultSetRow[i].field[0].substring(4, 6);

Mixed Endline

Mixed endline indentation preferably lays out code relative to the most recent left parenthesis, assignment or curly brace offset (the hotspots). Whenever rigorously orienting on only the current hotspot would lead to a crossing of the maximal line length, the preceding hotspot is checked. This process is done recursively, therefore in rare cases, this strategy produces the exact same result as standard indentation. Mixed endline indentation uses bigger white space gaps than standard indentation as code tends to move towards the right edge—but this keeps related code more closely together. The downside is that indentation is not so uniformly distributed and more vertical space might be occupied.

When mixed endline indentation is enabled, line wrapping will always try to keep lines within the maximal line length.

Example 2.263. Method declaration

public void severalParameters(String one, int two,
                              String three,
                              StringObject four,
                              AnotherObject five)
{
}

Example 2.264. Method call

vector.add(new AppServer(
               "RemoteApplicationManager",
               poa.create_reference_with_id(
                   "RemoteApplicationManager"
                   .getBytes(),
                   RemoteApplicationManager
                   .id())));

Example 2.265. Assignment

doublette[PflegeController.GEBURTSDATUM] =
    resultSetRow[i].field[0].substring(0, 2) + "." +
    resultSetRow[i].field[0].substring(2, 4) + "." +
    resultSetRow[i].field[0].substring(4, 6);

Strict Endline

Strict endline indentation always lays out code relative to the most recent left parenthesis, assignment or curly brace offset (the hotspots). This way consecutive code sections are somewhat easier to recognize at the possible downside of consuming more vertical and/or horizontal space.

Strict endline indentation generally tries to keep lines within the maximal line length, but favors aligning over wrapping, and thus will often lead to code crossing the maximal line length.

Note

It is recommend to avoid this strategy when possible, because depending on your wrapping settings it can produce quite scary results. It’s mostly available for historic reasons in order to provide backwards compatibility and allow for a smooth transition phase

Example 2.266. Method declaration

public void severalParameters(String one, int two,
                              String three,
                              StringObject four,
                              AnotherObject five)
{
}

Example 2.267. Method call

vector.add(new AppServer("RemoteApplicationManager",
                         poa
                         .create_reference_with_id("RemoteApplicationManager"
                                                   .getBytes(),
                                                   RemoteApplicationManager
                                                   .id())));

Example 2.268. Assignment

doublette[PflegeController.GEBURTSDATUM] = resultSetRow[i]
                                           .field[0]
                                           .substring(0,
                                                      2) +
                                           "." +
                                           resultSetRow[i]
                                           .field[0]
                                           .substring(2,
                                                      4) +
                                           "." +
                                           resultSetRow[i]
                                           .field[0]
                                           .substring(4,
                                                      6);

Regarding array initializers, any of the endline indentation strategies will cause the initializer to be printed right after the assignment. But when enabled, standard indentation might cause the initializer to be printed on a line of its own (but only when the initializer takes more than one line to print).

Example 2.269. Array initializer (Endline indented)

String[] s = { "first" };   |
                            |
String[] s = {              |
                 "first",   |
                 "second"   |
             };             |

Example 2.270. Array initializer (Standard indented)

String[] s = { "first" };   |
                            |
String[] s =                |
    {                       |
        "first",            |
        "second"            |
    };                      |

If you want to enforce a line break before all array initializers, you need to disable the compact brace printing for array initializers. See Section 2.8.6.2.3, “Arrays” for more information.

Always increase indentation on hotspots

By default, Jalopy always increases indentation after certain code elements to emphasize scope and nesting level. Depending on your settings, hotspots might be left curly braces, left parentheses, operators and certain keywords like return and assert. Now, it can be that indentation is increased in a way that could be seen as superfluous, because already one level of indentation would be enough to indicate the basic logical structure of a code statement.

Example 2.271. Always increase indentation on hotspots

Object value = calculateValue( getFirstNumber(),
»   »   getSecondNumber(), getThirdNumber() );


As you can see from the above example, if the option is enabled, indentation will be increased on every hotspot (here the assignment and left parentheses), which for deeply nested code can easily take up quite some horizontal space. The second increase does not add significant information. If you prefer a more dense layout, disabling the option will cause indentation to be increased only when really necessary. The result often takes considerably less horizontal space without loosing significant information.

Example 2.272. Only increase indentation when absolutely necessary

Object value = calculateValue( getFirstNumber(),
»   getSecondNumber(), getThirdNumber() );


Here, the indentation is only increased once within the statement and thus upon wrapping the remaining call arguments are indented only one level.

Since 1.7

2.8.8.1.2. Sizes

Lets you set different indentation sizes.

Original Tab indent

For documents that contain real tabs, specifies the number of spaces per tab stop. Look in your IDE editor or formatting settings for the “Tab Size” or “Tab Width” option and set the Jalopy option to the value found there.

Important

Please be aware that it is essential to set the correct tab size. Otherwise some indentations or alignments may fail

General indent

Specifies the number of spaces to use for general indentation (studies have found that 2 to 4 spaces for indentation is optimal).

Example 2.273. 2 space general indent

public class Preferences {
->private Preferences()
->{
->}

->public static void main(String[] argv) {
->->com.triemax.jalopy.swing.PreferencesDialog.main(argv);
->}
}

Example 2.274. 4 space general indent

public class Preferences {
--->private Preferences() {
--->}

--->public static void main(String[] argv) {
--->--->com.triemax.jalopy.swing.PreferencesDialog.main(argv);
--->}
}

Leading indent

Specifies the number of spaces to prepend before every line printed.

Example 2.275. 6 space leading indent

----->public class Preferences {
----->    private Preferences() {
----->    }

----->    public static void main(String[] argv) {
----->        com.triemax.jalopy.swing.PreferencesDialog.main(argv);
----->    }
----->}

Continuation indent

Specifies the number of spaces that should be inserted in front of continuation lines, i.e. the consecutive lines in case of a line wrap. Please note that this option only takes effect if continuation indentation is enabled. Refer to Section 2.8.8.2.2, “Continuation indent” for information on how to enable continuation indentation.

Example 2.276. 2 space continuation indent

if ((condition1 && condition2)
    ->|| (condition3 && condition4)
    ->|| !(condition5 && condition6)) {
    doSomethingAboutIt();
}

Example 2.277. 4 space continuation indent

if ((condition1 && condition2)
    --->|| (condition3 && condition4)
    --->|| !(condition5 && condition6)) {
    doSomethingAboutIt();
}

Comment indent

Specifies the number of spaces to insert between trailing comments and the preceding statement.

Example 2.278. 3 space trailing comment indent

new String[] {
    "Sunday",-->// Sunday
    "Monday",-->// Monday
    "Tuesday",-->// Tuesday
    "Wednesday",-->// Wednesday
    "Thursday",-->// Thursday
    "Friday",-->// Friday
    "Saturday"-->// Saturday
}

Cuddled braces indent

Specifies the number of spaces to print before the left curly brace of cuddled empty braces.

Example 2.279. 3 space cuddled braces indent

try {
    in.close();
} catch (IOException ignored)-->{}

See Section 2.8.6.2.4, “Cuddle braces” for more information about the empty braces handling.

Extends indent

When enabled, specifies the white space to print before the extends keyword in case it was printed on a new line.

Example 2.280. extends indentation with 6 spaces

public interface Channel
------>extends Puttable, Takable {
    ...
}

Implements indent

Specifies the white space to print before the implements keyword in case it was printed on a new line.

Example 2.281. implements indentation with 8 spaces

public class SynchronizedBoolean
------->implements Comparable, Cloneable {
    ...
}

Throws indent

Specifies the white space to print before the throws keyword in case it was printed on a new line.

Example 2.282. throws indentation with 3 spaces

private static final File getDestinationFile(File dest, String packageName,
                                             String filename)
-->throws IOException, FooException {
    ...
}

2.8.8.2. Misc

Lets you control miscellaneous indentation settings.

Figure 2.42. Indentation Misc settings page

Indentation Misc settings page

2.8.8.2.1. Indent
Indent class bodies

When enabled, indentation is increased for statements within class, interface, enum and annotation type declarations. Disabling this option might only make sense when using the GNU brace style.

Since 1.4

Example 2.283. Indented class body

public class Foo
    {
    --->public Foo()
    --->    {
    --->    }

    --->public boolean isFoo(Object other)
    --->    {
    --->        return other instanceof Foo;
    --->    }
    }

Example 2.284. Class body without increased indentation

public class Foo
    {
    public Foo()
        {
        }

    public boolean isFoo(Object other)
        {
            return other instanceof Foo;
        }
    }

Indent method bodies

When enabled, indentation is increased for statements within method and constructor bodies. Disabling this option might only make sense when using the GNU brace style.

Since 1.4

Example 2.285. Indented method body

public void toString()
    {
    --->return this.line + " " + this.column + " " + this.text;
    }

Example 2.286. Method body without increased indentation

public void toString()
    {
    return this.line + " " + this.column + " " + this.text;
    }

Indent “switch” bodies

The Sun Java code convention recommends a switch style where case statements are not indented relative to the switch statement as a whole. However, this option allows you to indent the case statements to make the entire switch statement stand out.

Example 2.287. Switch statement (unindented)

switch (prio) {
case Priority.ERROR_INT :
case Priority.FATAL_INT :
    color = Color.red;
    break;

case Priority.WARN_INT :
    color = Color.blue;
    break;

default:
    color = Color.black;
    break;
}

Example 2.288. Switch statement (indented)

switch (prio) {
--->case Priority.ERROR_INT :
--->case Priority.FATAL_INT :
--->    color = Color.red;
--->    break;

--->case Priority.WARN_INT :
--->    color = Color.blue;
--->    break;

--->default:
--->    color = Color.black;
--->    break;
}

Indent “case” bodies

When enabled, indentation is increased for statements within case statement bodies.

Since 1.4

Example 2.289. Indented case bodies

switch (prio) {
    case Priority.ERROR_INT :
    case Priority.FATAL_INT :
    --->color = Color.red;
    --->break;

    case Priority.WARN_INT :
    --->color = Color.blue;
    --->break;

    default:
    --->color = Color.black;
    --->break;
}

Example 2.290. Case statements without increased indentation

switch (prio) {
    case Priority.ERROR_INT :
    case Priority.FATAL_INT :
    color = Color.red;
    break;

    case Priority.WARN_INT :
    color = Color.blue;
    break;

    default:
    color = Color.black;
    break;
}

Indent block bodies

When enabled, indentation is increased for statements within blocks. Disabling this option might only make sense when using the GNU brace style.

Since 1.4

Example 2.291. Indented block

if (true)
    {
    --->doStuff();
    --->assertStuffDoneCorrectly();
    }

Example 2.292. Block without increased indentation

if (true)
    {
    doStuff();
    assertStuffDoneCorrectly();
    }

Indent labels

Specifies whether labels should be indented with the current indentation level.

Example 2.293. Unindented label

// advance to the first CLASS_DEF or INTERFACE_DEF
LOOP:
        for (AST child = tree.getFirstChild();
             child != null;
             child = child.getNextSibling()) {
            switch (child.getType()) {
                case JavaTokenTypes.CLASS_DEF :
                case JavaTokenTypes.INTERFACE_DEF :
                    next = child;
                    break LOOP;
                default :
                    break;
            }
        }

Example 2.294. Indented label

--->--->// advance to the first CLASS_DEF or INTERFACE_DEF
--->--->LOOP:
        for (AST child = tree.getFirstChild();
             child != null;
             child = child.getNextSibling()) {
            switch (child.getType()) {
                case JavaTokenTypes.CLASS_DEF :
                case JavaTokenTypes.INTERFACE_DEF :
                    next = child;
                    break LOOP;

                default :
                    break;
            }
        }

Indent dotted expressions

When enabled, indentation is increased for dotted expressions. This option is only present for historic reasons—to be able to address some unwanted behavior without breaking backwards compatibility. It is recommended to have this option always enabled.

Since 1.9

Example 2.295. Unindented dotted expression

((org.omg.CORBA_2_3.portable.OutputStream) s)
.write_abstract_interface(o);

Example 2.296. Indented dotted expression

((org.omg.CORBA_2_3.portable.OutputStream) s)
    .write_abstract_interface(o);

Indent ternary operands

When enabled, indentation is increased for the operands of the ternary operator. This option is only present for historic reasons—to be able to address some unwanted behavior without breaking backwards compatibility. It is recommended to have this option always enabled.

Since 1.8

Example 2.297. Indented ternary operands

text.setValidationSpec(config.getSpecification(),       |
                       config.getAda(data               |
                                     .hasTransmittal()  |
                                     ? data             |
                                       .getTransmitter()|
                                       .getElement()    |
                                     : data             |
                                       .getElement())); |

Example 2.298. Unindented ternary operands

text.setValidationSpec(config.getSpecification(),       |
                       config.getAda(data               |
                                     .hasTransmittal()  |
                                     ? data             |
                                     .getTransmitter()  |
                                     .getElement()      |
                                     : data             |
                                     .getElement()));   |

Indent first column comments

By default, all comments will be indented relative to their position in the code to avoid that comments break the logical structure of the program. But as for certain kind of comments it may be useful to put them at the first column, you can control here whether such comments should be printed without indentation.

Example 2.299. First column comment

    public static Printer create(AST node) {

/*
        if (node == null) {
            return new NullPrinter();
        }
*/
        return create(node.getType());
    }

Example 2.300. Indented comment

    public static Printer create(AST node) {

        /*
        if (node == null) {
            return new NullPrinter();
        }
        */
        return create(node.getType());
    }

2.8.8.2.2. Continuation indent

Lets you specify extra indentation for consecutive lines of certain elements.

Declaration parameters

With standard indentation enabled, this option causes an extra increase of the indentation level upon wrapping of method and constructor parameters. With endline indentation this option is meaningless.

Example 2.301. Wrapped method parameters

public void aMethod(int param 1, int param2, |
    int param3) {                            |
    int a = param1 + param2 + param3;        |
}                                            |

Example 2.302. Wrapped method parameters with continuation indentation

public void aMethod(int param 1, int param2, |
        int param3) {                        |
    int a = param1 + param2 + param3;        |
}                                            |

Blocks

The Sun brace style could make seeing the statement body difficult. To work around this problem, you may want to use continuation indentation in case you like this brace style. This setting applies for if, for, while and do-while blocks.

Example 2.303. Non-continuation indentation

if ((condition1 && condition2)
    || (condition3 && condition4)
    || !(condition5 && condition6)) { // BAD WRAPS
    doSomethingAboutIt();             // MAKE THIS LINE EASY TO MISS
}

Example 2.304. Continuation indentation

if ((condition1 && condition2)
        || (condition3 && condition4)
        || !(condition5 && condition6)) {
    doSomethingAboutIt();
}

Refer to Section 2.8.6.1, “Layout” for the available brace style options.

Operators

When enabled, indentation will be increased before an operand will be printed.

Example 2.305. Ternary expression (endline indented)

String comma = spaceAfterComma
               --->? COMMA_SPACE
               --->: COMMA;

return statements

Lets you increase the indentation level after return statements. This is only meaningful when a statement cannot be printed in one line.

Since 1.6

Example 2.306. return statement

return auswahlkriteriumComboBox.getUnselectedValueContent()   |
.equals(auswahlkriteriumComboBox.getSelectedItem());          |

Example 2.307. return statement with continuation indentation

return auswahlkriteriumComboBox.getUnselectedValueContent()   |
    .equals(auswahlkriteriumComboBox.getSelectedItem());      |

As you can see from the above examples, without continuation indentation it might happen that wrapped lines are printed at the same indentation level as the return statement. It really depends where the line wrapping takes place. The two following examples indent both no matter what setting (though different, of course).

Example 2.308. return statement

return auswahlkriteriumComboBox.getUnselectedValueContent().equals(     |
    auswahlkriteriumComboBox.getSelectedItem());                        |

Example 2.309. return statement with continuation indentation

return auswahlkriteriumComboBox.getUnselectedValueContent().equals(     |
        auswahlkriteriumComboBox.getSelectedItem());                    |

2.8.8.2.3. Align

Lets you control what elements should be visually aligned to each other.

Enum constants

Lets you align the parameter lists of enum constants. Please note that aligning only takes place if “Wrap after enum constants” has been enabled as well.

Since 1.8

Example 2.310. Enum constants

public enum Code {
    NOT_READY((byte) 0x09),
    ERROR((byte) 0x10),
    ILLEGAL((byte) 0x11);
}

Example 2.311. Aligned enum constants

public enum Code {
    NOT_READY((byte) 0x09),
    ERROR    ((byte) 0x10),
    ILLEGAL  ((byte) 0x11);
}

Declaration parameters

When enabled, aligns the parameters of method/constructor declarations. This only applies if all parameters will be wrapped; either because wrapping is forced or the max. line length is reached. To force aligning, you have to enable the wrapping for method parameters. See “Declaration parameters” for more information.

Example 2.312. Method declaration parameters

public static File create(final File file,
                          File directory,
                          int backupLevel) {
    ...
}

Example 2.313. Method declaration parameters (aligned)

public static File create(final File file,
                          File       directory,
                          int        backupLevel) {
    ...
}

Variable identifiers

When enabled, the identifiers of consecutive variable declarations are aligned. You can control what declarations are treated as consecutive with different chunk options. Refer to Section 2.8.10.2.1, “Chunks” for more information.

Example 2.314. Variable identifiers

String text = "text";
int a = -1;
History.Entry entry = new History.Entry(text);

Example 2.315. Variable identifiers (aligned)

String        text = "text";
int           a = -1;
History.Entry entry = new History.Entry(text);

Assignments

When enabled, consecutive assignment expressions and the assignment parts of consecutive variable declarations are aligned. You can control what statements are treated as consecutive with different chunk options. Refer to Section 2.8.10.2.1, “Chunks” for more information.

Example 2.316. Variable assignments (aligned)

String text         = "text";
int a               = -1;
History.Entry entry = new History.Entry(text);

If both variable alignment options are enabled, you can achieve a style like the following:

Example 2.317. Variable identifiers/assignments (both aligned)

String        text  = "text";
int           a     = -1;
History.Entry entry = new History.Entry(text);

Chained method calls

When disabled, indentation happens according to the current indentation level.

Example 2.318. Method call chain (standard indented)

Schluesselerzeugung.createService()
.getNeuerSchluesselService(
    SchluesselService.SCHLUESSEL_KZ_INTERESSENT);

Otherwise indentation is performed relative to the column offset of the first chain link.

Example 2.319. Method call chain (aligned)

Schluesselerzeugung.createService()
                   .getNeuerSchluesselService(
                       SchluesselerzeugungService.SCHLUESSEL_KZ_INTERESSENT);

Please note that you can enforce line breaks for chained method calls, see “Wrap chained method call”.

Nested chained method calls

When disabled, indentation happens according to the current indentation level.

Since 1.6

Example 2.320. Method call chain (standard indented)

id = RefData.getSegmentId(RefData.getAccessor().getCutOff(fileInfo
                                                          .getCutoffId())
                          .getTheoreticalDate(),
                          fileInfo.getExternalSenderId(),
                          _fileType,
                          fileInfo.getCustomerFormat()
                          .getId());

Otherwise indentation is performed relative to the column offset of the first chain link.

Example 2.321. Method call chain (aligned)

id = RefData.getSegmentId(RefData.getAccessor()
                                 .getCutOff(fileInfo.getCutoffId())
                                 .getTheoreticalDate(),
                          fileInfo.getExternalSenderId(),
                          _fileType,
                          fileInfo.getCustomerFormat()
                                  .getId());

Please note that you can force line breaks for nested chained method calls, see “Wrap nested chained method call”.

Ternary expressions

If disabled, ternary expressions are printed according to the current indentation policy. See Section 2.8.8.1.1, “Strategies” for more information.

Example 2.322. Ternary operators (standard indented)

alpha = (aLongBooleanExpression) ? beta    |
: gamma;                                   |

Example 2.323. Ternary operators (endline indented)

alpha = (aLongBooleanExpression) ? beta    |
        : gamma;                           |

When enabled, the second operator will always be aligned relative to the first one.

Example 2.324. Ternary expressions (aligned)

alpha = (aLongBooleanExpression) ? beta    |
                                 : gamma;  |

Note that this option only takes effect, if indeed a line break was inserted before the second expression. You can enforce such line breaks. See “Wrap ternary expression colon” for more information.

Assertion expressions

When enabled, the second expression of assertion statements is aligned.

Example 2.325. Assertion expression (standard indented)

assert ((nBits & ~ALL_BITS) != 0) : "Invalid modifier bits: " +
    (nBits & ~ALL_BITS);

Example 2.326. Assertion expression (endline indented)

assert ((nBits & ~ALL_BITS) != 0) : "Invalid modifier bits: " +
        (nBits & ~ALL_BITS);

Example 2.327. Assertion expression (aligned)

assert ((nBits & ~ALL_BITS) != 0) : "Invalid modifier bits: " +
                                    (nBits & ~ALL_BITS);

Arrays

Forces alignment of the curly braces of array initializers with the declaration. This only applies when using either the standard indentation policy or mixed endline indentation policy, because here by default the braces are indented according to the current indentation level and therefore do not align.

Since 1.0.3

Example 2.328. Array initialization (standard indented)

private static String [] sFields =
    {
        "LOCATION.ID",
        "TRACKING_EVENT.CREATE_TIME",
        "TRACKING_EVENT.EVENT_TIME",
        "TRACKING_EVENT.ORIGIN_TIME_ZONE_OFFSET",
        "TRACKING_EVENT.EVENT_TYPE",
    };

Example 2.329. Array initialization (standard indented, but aligned)

private static String [] sFields =
{
    "LOCATION.ID",
    "TRACKING_EVENT.CREATE_TIME",
    "TRACKING_EVENT.EVENT_TIME",
    "TRACKING_EVENT.ORIGIN_TIME_ZONE_OFFSET",
    "TRACKING_EVENT.EVENT_TYPE",
};

Right parenthesis

Forces alignment of wrapped right parentheses with the declaration or call. This only applies when using standard indentation policy, because here by default the parentheses are indented according to the current indentation level.

Since 1.2.1

Example 2.330. Method call (standard indented, 2 spaces indent)

myMethod(
  getSomeValue(
    param1
    ),
  param2
  );

Example 2.331. Method call (standard indented, but aligned)

myMethod(
  getSomeValue(
    param1
  ),
  param2
);

Example 2.332. Method declaration (standard indented)

public MyCustomStringTemplate createTemplate(
    Map three, int one, // xxx
    String  two // xxx
    )
{
    ...
}

Example 2.333. Method declaration (standard indented, but aligned)

public MyCustomStringTemplate createTemplate(
  Map three, int one, // xxx
  String  two // xxx
)
{
    ...
}

Anonymous inner classes

Lets you force alignment of anonymous inner brace blocks according to the current indentation level. Only applies when standard indentation is used.

Since 1.6

Example 2.334. Anonymous inner class (standard indented)

Action action = new AbstractAction("action") {
        public void actionPerformed (ActionEvent ev) {
        }
    };

Example 2.335. Anonymous inner class (standard indented but aligned)

Action action = new AbstractAction("action") {
    public void actionPerformed (ActionEvent ev) {
    }
};

Endline comments

Aligns endline comments that belong together. You can control how Jalopy determines what comments belong together with the Chunk settings.

Since 1.9

Example 2.336. Endline comments

if (m.tryMatch(h)) { // help match
    casHead(h, mn); // pop both h and m
} else { // lost match
    h.casNext(m, mn); // help unlink
}

Example 2.337. Aligned endline comments

if (m.tryMatch(h)) {  // help match
    casHead(h, mn);   // pop both h and m
} else {              // lost match
    h.casNext(m, mn); // help unlink
}

2.8.8.3. Tabs

Lets you control the tab settings.

Figure 2.43. Indentation Tabs settings page

Indentation Tabs settings page

Use tabs to indent

Normally, Jalopy uses spaces to indent lines. If you prefer hard tabs, check this option. You can change the original tab indent on the general indentation settings page, see the Original Tab indent option.

Please note that it is very important that you specify the correct tab size for your original sources on the general indentation page.

Example 2.338. Use tabs for indentation

»   if ( true ) {
»   »   methodCall(param1,
»   »   »   param2
»   »   »   param3);
»   }

Use only leading tabs

When enabled, tabs are only used up to the current brace level, spaces are used afterwards.

Example 2.339. Leading indentation

»   if (test()) {
»   »   methodCall(param1,
»   »   ····param2
»   »   ····param3);
»   }

Use tabs in comments

When enabled, hard tabs are used for printing indentation in comments.

Since 1.2.1

Example 2.340. Comment that uses spaces for indentation

//······System.out.println("DEBUG: line=" + _line);

Example 2.341. Comment that uses tabs for indentation

//» »···System.out.println("DEBUG: line=" + _line);