Relax Checkstyle RightCurly rule for LITERAL_WHILE 08/55708/2
authorMichael Vorburger <vorburger@redhat.com>
Wed, 19 Apr 2017 18:09:03 +0000 (20:09 +0200)
committerRobert Varga <nite@hq.sk>
Thu, 20 Apr 2017 18:09:54 +0000 (18:09 +0000)
In the Checkstyle upgrade from 6.16 to 7.6.1 done in parallel in other
changes, I've come across a number of "violations" because it did not
like "... } while (condition)" in one line.

This indeed seems to be what our current Checkstyle rule would mandate,
but because of what looks like a bug in our currently used version 6.16
was never enforced.  As we upgrade, they seem to have fixed that, so
either we add a \n after } before while during the upgrade in the
projects which are already enforcing Checkstyle - or we just relax this
rule - personally I think it's ugly on two lines, and thus suggest this.

See http://checkstyle.sourceforge.net/config_blocks.html#RightCurly

I have not actually really tested this, just seems above right.

Change-Id: I21e20d91b854340a636c4fbbe5a6038caf0bee57
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
(cherry picked from commit 3d622f95319336f5a5b9587b924bd6bac98982d7)

checkstyle/src/main/resources/odl_checks.xml

index f1c23365b16285a2f0bb00bb3fc77516c0ae9277..1c28a1613879f4aac28d0ca9c09b543d92870c4c 100644 (file)
@@ -63,7 +63,7 @@
         <module name="RightCurly"/>
         <module name="RightCurly">
             <property name="option" value="alone"/>
-            <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
+            <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
         </module>
         <module name="WhitespaceAround">
             <property name="allowEmptyConstructors" value="true"/>