View Javadoc
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  import java.util.logging.Logger;
13  
14  public class InputRequireThisExtendedMethod
15  {
16      public class Check {
17          private Logger log1 = Logger.getLogger(getClass().getName());
18      }
19  
20      String ELIST;
21      String method(Object a) {
22          String ELIST = "abc";
23          ELIST = this.method(new Check() {
24          });
25          return "";
26      }
27  
28      int EXPR;
29  
30      String method(int EXPR) {
31          EXPR += 12; // violation 'Reference to instance variable 'EXPR' needs "this.".'
32          return "someString";
33      }
34  }