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  tokens = NUM_DOUBLE, NUM_FLOAT, NUM_INT
11  
12  
13  */
14  
15  package com.puppycrawl.tools.checkstyle.checks.coding.magicnumber;
16  
17  import java.util.ArrayList;
18  import java.util.HashSet;
19  import java.util.List;
20  import java.util.Set;
21  
22  public class InputMagicNumberMagicNumber3 {
23  
24      Object obj = new Object() {
25  
26          class Inner {
27              int a = 0;
28              int b = 9;
29              double e = 0;
30              double c = 5.5;
31              float d = 12.2f;
32              Set<Person> p1 = new HashSet<Person>(5);
33              Object[] values = new Object[3];
34              String[] fStrings = new String[3];
35              Person p = new Person(8);
36              List<Integer> multisets = new ArrayList(0x10000);
37          }
38      };
39  }
40  
41  class outside {
42  
43      class inside {
44          int a = 0;
45          int b = 9;
46          double e = 0;
47          double c = 5.5;
48          float d = 12.2f;
49          Set<Person> p1 = new HashSet<Person>(5);
50          Object[] values = new Object[3];
51          String[] fStrings = new String[3];
52          Person p = new Person(8);
53          List<Integer> multisets = new ArrayList(0x10000);
54      }
55  }
56  
57  class outer {
58  
59      class inner {
60  
61          Object obj = new Object() {
62              int a = 0;
63              int b = 9;
64              double e = 0;
65              double c = 5.5;
66              float d = 12.2f;
67              Set<Person> p1 = new HashSet<Person>(5);
68              Object[] values = new Object[3];
69              String[] fStrings = new String[3];
70              Person p = new Person(8);
71              List<Integer> multisets = new ArrayList(5);
72  
73              class innerMost {
74                  int a = 0;
75                  int b = 9;
76                  double e = 0;
77                  double c = 5.5;
78                  float d = 12.2f;
79                  Set<Person> p1 = new HashSet<Person>(5);
80                  Object[] values = new Object[3];
81                  String[] fStrings = new String[3];
82                  Person p = new Person(8);
83                  List<Integer> multisets = new ArrayList(0x10000);
84              }
85          };
86      }
87  }
88  
89  class Class {
90      Person c = new Person(3) {
91  
92          int a = 0;
93          int b = 9;
94          double e = 0;
95          double c = 5.5;
96          float d = 12.2f;
97          Set<Person> p1 = new HashSet<Person>(5);
98          Object[] values = new Object[3];
99          String[] fStrings = new String[3];
100         Person p = new Person(8);
101         List<Integer> multisets = new ArrayList(5);
102 
103         public void magicMethod() {
104             int a = 0;
105             int b = 1;
106             double e = 0;
107         }
108     };
109 }