1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.puppycrawl.tools.checkstyle.checks.coding.magicnumber;
18
19 class InputMagicNumberIntegersOnly3 {
20
21 public int hashCode() {
22 return 31;
23 }
24
25
26 public int hashCode(int val) {
27 return 42;
28 }
29
30
31 public int hashcode() {
32 return 13;
33 }
34
35 static {
36 int x=21;
37 }
38
39 {
40 int y=37;
41 }
42
43 public InputMagicNumberIntegersOnly3() {
44 int z=101;
45 }
46
47 @InputMagicNumberIntMethodAnnotation(42)
48 public void another() {
49 }
50
51 @InputMagicNumberIntMethodAnnotation(value=43)
52 public void another2() {
53 }
54
55 @InputMagicNumberIntMethodAnnotation(-44)
56 public void anotherNegative() {
57 }
58
59 @InputMagicNumberIntMethodAnnotation(value=-45)
60 public void anotherNegative2() {
61 }
62 }
63
64 class TestMethodCallIntegersOnly3 {
65
66 public TestMethodCallIntegersOnly3(int x){
67
68 }
69
70 public void method2() {
71 final TestMethodCallIntegersOnly3 dummyObject = new TestMethodCallIntegersOnly3(62);
72 }
73 }
74
75 class BinaryIntegersOnly3 {
76 int intValue = 0b101;
77 long l = 0b1010000101000101101000010100010110100001010001011010000101000101L;
78 }
79 @interface AnnotationWithDefaultValueIntegersOnly3 {
80 int value() default 101;
81 int[] ar() default {102};
82 }
83 class AIntegersOnly3 {
84 {
85 switch (Blah2IntegersOnly1.LOW) {
86 default:
87 int b = 122;
88 }
89 }
90 }