View Javadoc
1   /*
2   UnusedLocalVariable
3   allowUnnamedVariables = false
4   
5   */
6   package com.puppycrawl.tools.checkstyle.checks.coding.unusedlocalvariable;
7   
8   public class InputUnusedLocalVariableNestedClasses6 {
9     int a = 12;
10  
11    void foo() {
12      int a = 12; // violation, unused variable 'a'
13      int ab = 12; // violation, unused variable 'ab'
14  
15      class abc {
16        Test a = new Test() {
17          void abc() {
18            System.out.println(a);
19            int abc = 10;
20  
21            class def {
22              Test ab = new Test() {
23                void def() {
24                  System.out.println(abc);
25                }
26              };
27            }
28          }
29        };
30      }
31    }
32  }