Skip to content

Latest commit

 

History

History
64 lines (46 loc) · 1.26 KB

SeparatorWrapDot.md

File metadata and controls

64 lines (46 loc) · 1.26 KB

Pattern: Wrong line wrapping with separators

Issue: -

Description

Checks line wrapping with separators.

Examples

Code example for comma and dot at the new line:

s
    .isEmpty();
foo(i
    ,s);

Configuration example:

<module name="SeparatorWrap"/>

Code example for comma and dot at the previous line:

s.
    isEmpty();
foo(i,
    s);

Example for checking method reference at new line (good case and bad case):

Arrays.sort(stringArray, String:: // violation
    compareToIgnoreCase);
Arrays.sort(stringArray, String
    ::compareToIgnoreCase); // good

An example of how to configure the check for METHOD_REF at new line:

<module name="SeparatorWrap">
    <property name="tokens" value="METHOD_REF"/>
    <property name="option" value="nl"/>
</module>

An example of how to configure the check for comma at the new line is:

<module name="SeparatorWrap">
    <property name="tokens" value="COMMA"/>
    <property name="option" value="nl"/>
</module>

Further Reading