Using Eclipse Juno I've got the following issue using the Java code formatter:
If a method call leads to a line break, Eclipse inserts a whitespace before the "dot" of the method invocation (_ shall denote the whitespace)
int nbo = new Foo()//linebreak
_.method();
Unfortunately this whitespace triggers a Checkstyle warning (NoWhitespaceBefore rule). Is there some possibility to stop eclipse inserting the whitespace? Or is it a Checkstyle configuration issue?
Thanks for your help in advance.
You can increase Maximum line width to 120 or bigger number.
You can resolve this either by changing the formatter settings or by changing the Checkstyle configuration.
Option 1 - Formatter Settings (for Eclipse 4.3, but should be the same for Juno)
Option 2 - Checkstyle Config
DOT
token from the NoWhitespaceBefore rule: <module name="NoWhitespaceBefore">
<property name="tokens" value="SEMI,POST_DEC,POST_INC"/>
</module>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.