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 public class InputMagicNumberDefault3 {
18
19 public int hashCode() {
20 return 31;
21 }
22
23
24 public int hashCode(int val) {
25 return 42;
26 }
27
28
29 public int hashcode() {
30 return 13;
31 }
32
33 static {
34 int x=21;
35 }
36
37 {
38 int y=37;
39 }
40
41 public InputMagicNumberDefault3() {
42 int z=101;
43 }
44
45 @InputMagicNumberIntMethodAnnotation(42)
46 public void another() {
47 }
48
49 @InputMagicNumberIntMethodAnnotation(value=43)
50 public void another2() {
51 }
52
53 @InputMagicNumberIntMethodAnnotation(-44)
54 public void anotherNegative() {
55 }
56
57 @InputMagicNumberIntMethodAnnotation(value=-45)
58 public void anotherNegative2() {
59 }
60 }
61
62 class TestMethodCallDefault3 {
63
64 public TestMethodCallDefault3(int x){
65
66 }
67
68 public void method2() {
69 final TestMethodCallDefault3 dummyObject = new TestMethodCallDefault3(62);
70 }
71 }
72
73 class BinaryDefault3 {
74 int intValue = 0b101;
75 long l = 0b1010000101000101101000010100010110100001010001011010000101000101L;
76 }
77 @interface AnnotationWithDefaultValueDefault3 {
78 int value() default 101;
79 int[] ar() default {102};
80 }
81 class ADefault3 {
82 {
83 switch (Blah2Default1.LOW) {
84 default:
85 int b = 122;
86 }
87 }
88 }