View Javadoc
1   /*
2   MagicNumber
3   ignoreNumbers = (default)-1, 0, 1, 2
4   ignoreHashCodeMethod = (default)false
5   ignoreAnnotation = true
6   ignoreFieldDeclaration = true
7   ignoreAnnotationElementDefaults = (default)true
8   constantWaiverParentToken = (default)TYPECAST, METHOD_CALL, EXPR, ARRAY_INIT, UNARY_MINUS, \
9                               UNARY_PLUS, ELIST, STAR, ASSIGN, PLUS, MINUS, DIV, LITERAL_NEW, \
10                              SR, BSR, SL, BXOR, BOR, BAND, BNOT, QUESTION, COLON, EQUAL, NOT_EQUAL, \
11                              GE, GT, LE, LT, MOD
12  tokens = NUM_DOUBLE, NUM_FLOAT, NUM_INT
13  
14  
15  */
16  
17  package com.puppycrawl.tools.checkstyle.checks.coding.magicnumber;
18  
19  import java.util.ArrayList;
20  import java.util.HashSet;
21  import java.util.List;
22  import java.util.Set;
23  
24  public class InputMagicNumberMagicNumber3 {
25  
26      Object obj = new Object() {
27  
28          class Inner {
29              int a = 0;
30              int b = 9;
31              double e = 0;
32              double c = 5.5;
33              float d = 12.2f;
34              Set<Person> p1 = new HashSet<Person>(5);
35              Object[] values = new Object[3];
36              String[] fStrings = new String[3];
37              Person p = new Person(8);
38              List<Integer> multisets = new ArrayList(0x10000);
39          }
40      };
41  }
42  
43  class outside {
44  
45      class inside {
46          int a = 0;
47          int b = 9;
48          double e = 0;
49          double c = 5.5;
50          float d = 12.2f;
51          Set<Person> p1 = new HashSet<Person>(5);
52          Object[] values = new Object[3];
53          String[] fStrings = new String[3];
54          Person p = new Person(8);
55          List<Integer> multisets = new ArrayList(0x10000);
56      }
57  }
58  
59  class outer {
60  
61      class inner {
62  
63          Object obj = new Object() {
64              int a = 0;
65              int b = 9;
66              double e = 0;
67              double c = 5.5;
68              float d = 12.2f;
69              Set<Person> p1 = new HashSet<Person>(5);
70              Object[] values = new Object[3];
71              String[] fStrings = new String[3];
72              Person p = new Person(8);
73              List<Integer> multisets = new ArrayList(5);
74  
75              class innerMost {
76                  int a = 0;
77                  int b = 9;
78                  double e = 0;
79                  double c = 5.5;
80                  float d = 12.2f;
81                  Set<Person> p1 = new HashSet<Person>(5);
82                  Object[] values = new Object[3];
83                  String[] fStrings = new String[3];
84                  Person p = new Person(8);
85                  List<Integer> multisets = new ArrayList(0x10000);
86              }
87          };
88      }
89  }
90  
91  class Class {
92      Person c = new Person(3) {
93  
94          int a = 0;
95          int b = 9;
96          double e = 0;
97          double c = 5.5;
98          float d = 12.2f;
99          Set<Person> p1 = new HashSet<Person>(5);
100         Object[] values = new Object[3];
101         String[] fStrings = new String[3];
102         Person p = new Person(8);
103         List<Integer> multisets = new ArrayList(5);
104 
105         public void magicMethod() {
106             int a = 0;
107             int b = 1;
108             double e = 0;
109         }
110     };
111 }