1 /*xml 2 <module name="Checker"> 3 <module name="TreeWalker"> 4 <module name="RequireThis"> 5 <property name="validateOnlyOverlapping" value="false"/> 6 </module> 7 </module> 8 </module> 9 */ 10 package com.puppycrawl.tools.checkstyle.checks.coding.requirethis; 11 12 // xdoc section -- start 13 class Example5 { 14 int field1,field2; 15 16 public void foo(int field1) { 17 field1 = this.field1; 18 19 if (field1 > 0) { 20 field1 = -field1; 21 } 22 // violation below, reference to instance variable "field2" requires "this" 23 field2 *= field1; 24 } 25 } 26 // xdoc section -- end