Page 1 of 1

r9825 Discussion

PostPosted: 20 Aug 2011, 18:42
by Braids
@Dave, i think this pattern allows spaces in blank lines. should it not be the following instead?

from
<property name="format" value="[^\*]\s+$"/>

to
<property name="format" value="(^|[^\*])\s+$"/>

Re: r9825 Discussion

PostPosted: 20 Aug 2011, 22:32
by jendave
Braids wrote:@Dave, i think this pattern allows spaces in blank lines. should it not be the following instead?

from
<property name="format" value="[^\*]\s+$"/>

to
<property name="format" value="(^|[^\*])\s+$"/>
Good catch. Checked in patch r9833.

Re: r9825 Discussion

PostPosted: 20 Aug 2011, 23:08
by Braids
edit: thank you.

i was just thinking, it still ignores spaces after any asterisk, not just one in javadoc. . . but then i realized. last time i used CheckStyle, it didn't like lines ending with operators like multiplication asterisk. so i don't think we need to change it.

yes, it definitely works:
Code: Select all
int x = 2 *{space}
    2;
CheckStyle says '*' should be on a new line. :D

oh, wow! your pattern only allows one space after an asterisk. i wonder why? oh, because in "whatever*{space}{space}", the first space matches the [^\*] in the pattern, and the second one matches the \s+. i like it this way. . . Eclipse only puts one space there, anyway.

Code: Select all
1:/*
2: *{space}
3: *{space}{space}
4: */
CheckStyle says line 3 has trailing spaces! i'm getting way too excited about this. =P~