1 /*xml 2 <module name="Checker"> 3 <module name="TreeWalker"> 4 <module name="WhitespaceAround"> 5 <property name="tokens" 6 value="ASSIGN, DIV_ASSIGN, PLUS_ASSIGN, MINUS_ASSIGN, STAR_ASSIGN, 7 MOD_ASSIGN, SR_ASSIGN, BSR_ASSIGN, SL_ASSIGN, BXOR_ASSIGN, 8 BOR_ASSIGN, BAND_ASSIGN"/> 9 </module> 10 </module> 11 </module> 12 13 14 */ 15 16 package com.puppycrawl.tools.checkstyle.checks.whitespace.whitespacearound; 17 18 // xdoc section -- start 19 class Example2 { 20 void example() { 21 int b=10; // 2 violations 22 // no space before and after'=' 23 int c = 10; 24 b+=10; // 2 violations 25 // no space before and after'+=' 26 b += 10; 27 c*=10; // 2 violations 28 // no space before and after'*=' 29 c *= 10; 30 c-=5; // 2 violations 31 // no space before and after'-=' 32 c -= 5; 33 c/=2; // 2 violations 34 // no space before and after'/=' 35 c /= 2; 36 c%=1; // 2 violations 37 // no space before and after'%=' 38 c %= 1; 39 c>>=1; // 2 violations 40 // no space before and after'>>=' 41 c >>= 1; 42 c>>>=1; // 2 violations 43 // no space before and after'>>>=' 44 c >>>= 1; 45 } 46 } 47 // xdoc section -- end