1
2
3
4
5
6
7
8
9
10
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 InputMagicNumberMagicNumber2 {
23 {
24 int a = 0;
25 int b = 9;
26 double e = 0;
27 double c = 5.5;
28 float d = 12.2f;
29 }
30
31 void foo(){
32 {
33 int notField = 45;
34 int notField2 = 1;
35 }
36 }
37
38 void foo2() {
39 {
40 int a = 0;
41 int b = 9;
42 double e = 0;
43 double c = 5.5;
44 float d = 12.2f;
45 }
46 }
47
48 {
49 Set<Person> p1 = new HashSet<Person>(5);
50 Object[] values = new Object[5];
51 String[] fStrings = new String[5];
52 Person p = new Person(5);
53 List<Integer> multisets = new ArrayList(5);
54 }
55
56 {
57 Set<Person> p1 = new HashSet<Person>(1);
58 Object[] values = new Object[1];
59 String[] fStrings = new String[1];
60 Person p = new Person(1);
61 List<Integer> multisets = new ArrayList(1);
62 }
63
64 void method() {
65 {
66 Set<Person> p1 = new HashSet<Person>(5);
67 Object[] values = new Object[5];
68 String[] fStrings = new String[5];
69 Person p = new Person(5);
70 List<Integer> multisets = new ArrayList(5);
71 }
72
73 {
74 Set<Person> p1 = new HashSet<Person>(1);
75 Object[] values = new Object[1];
76 String[] fStrings = new String[1];
77 Person p = new Person(1);
78 List<Integer> multisets = new ArrayList(1);
79 }
80 }
81 }