Pattern: Wrong line wrapping with separators
Issue: -
Checks line wrapping with separators.
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>