View Javadoc
1   package com.puppycrawl.tools.checkstyle.checks.coding.requirethis;
2   
3   public class InputRequireThisAnonymousEmpty {
4   
5       private int bar;
6   
7       interface AnonWithEmpty {
8           public void fooEmpty();
9       }
10  
11      void method() {
12          AnonWithEmpty foo = new AnonWithEmpty() {
13  
14              public void emptyMethod() {
15              }
16  
17              @Override
18              public void fooEmpty() {
19                  int a = doSideEffect();
20              }
21  
22              public int doSideEffect() {
23                  return bar;
24              }
25          };
26  
27          new AnonWithEmpty() {
28              int anonMember = 0;
29  
30              @Override
31              public void fooEmpty() {
32                  new AnonWithEmpty() {
33  
34                      @Override
35                      public void fooEmpty() {
36                          anonMember++;
37                      }
38                  };
39              }
40          };
41  
42          new AnonWithEmpty() {
43              int foobar = 1;
44              @Override
45              public void fooEmpty() {
46                  foobar++;
47              }
48          };
49      }
50  }