[Skip to content]

Changes

This document describes the changes in the Java formatter engine of Jalopy 1.2 that may have an impact on formatting style (depending on your code convention).

Exceeded line length after type cast

Method calls after type casts could exceed the maximal line length

                                                             |
Trader9Message myMessage = (Trader9Message)                  |
    myMessageEntry.getMessage().clone();                     |

was wrongly formatted as

                                                             |
Trader9Message myMessage = (Trader9Message) myMessageEntry.getMessage()
    .clone();                                                |

Now it will be printed (depending on your settings)

                                                             |
Trader9Message myMessage = (Trader9Message) myMessageEntry   |
    .getMessage().clone();                                   |

Always line break after assignment for logical not

Line wrap happened always after assignments when the expression started with the logical not operator and did not fit into the line. Now the "Always wrap after assignment when exceed" setting is repected and line wrap happens only when no wrapping at lower level may occur if the option is disabled

result = !isLineBreakBeforeCreator(child,   |
        assign, emitter);                   |

was wrongly formatted as

result =                                    |
    !isLineBreakBeforeCreator(child, assign,|
        emitter);                           |

Now it will be printed (depending on your settings)

result = !isLineBreakBeforeCreator(child,   |
        assign, emitter);                   |

Exceeded line in ternary operator when operand with parentheses

Operands of the ternary operator that were enclosed with parentheses could exceed the maximal line length.

                                          |
int length = (column >= maxLength) ? (column - offset) : offset;
                                          |

was wrongly formatted as

                                          |
int length = (column >= maxLength) ? (column
    - offset) : offset;                   |

Now it will be printed (depending on your settings)

                                          |
int length = (column >= maxLength)        |
    ? (column - offset) : offset;         |

Wrapping within parentheses prefered for ternary operands

Wrapping for operands of the Java ternary operator that were enclosed with parentheses preferably occured within the parentheses.

                                       |
int length = (column > (offset + indentSize))
    ? (column - indentLengh) : column; |
                                       |

was wrongly formatted as

                                       |
int length = (column > (offset         |
        + indentSize))                 |
    ? (column - indentLengh) : column; |
                                       |

Now it will be printed (depending on your settings)

                                       |
int length =                           |
    (column > (offset + indentSize))   |
    ? (column - indentLengh) : column; |
                                       |

Arrays were always wrapped

Arrays were always wrapped according to the Array wrapping options, even when line wrapping was disabled.

String[] c = {                    |
    "panel.top=form.top",         |
    "panel.hcenter=form.hcenter"  |
};                                |

will now be printed in just one line when line wrapping is disabled.

String[] c = { "panel.top=form.top", "panel.hcenter=form.hcenter" };

What is Jalopy?

Jalopy is a world-class source code formatter for Java. It automates and enforces all aspects of source code layout—to meet a certain coding style without putting any burden on individual developers.

Learn more

Who needs it?

Jalopy is for everyone involved with source code editing. It scales from single developer usage to large scale enterprise deployment and seamlessly integrates with your favorite Java IDE or build tool.

Go and see yourself

I want some!

Concentrate on your problem domain and don’t waste time shuffling characters around. Pricing starts at USD $40 for a single-user license. Buy now using secure online purchase or wire transfer.

What are you waiting for?

Learn the details

Deploy, configure and use the software to best meet your needs. Download the printable user’s guide and learn everything there is to know to put Jalopy’s capabilities to full use.

Download (.pdf - 8.3MB)