1 /* 2 RequireThis 3 checkFields = (default)true 4 checkMethods = (default)true 5 validateOnlyOverlapping = false 6 7 8 */ 9 10 package com.puppycrawl.tools.checkstyle.checks.coding.requirethis; 11 12 public class InputRequireThisSimple { 13 private final int number = 1; 14 15 public int check() { 16 int sum = number; // violation 'Reference to instance variable 'number' needs "this.".' 17 sum += other(); // violation 'Method call to 'other' needs "this.".' 18 return sum; 19 } 20 21 private int other() { 22 return 0; 23 } 24 }