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).
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(); |
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); |
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 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 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" };