1
2
3
4
5
6
7 package com.puppycrawl.tools.checkstyle.checks.design.finalclass;
8
9 import java.util.ArrayList;
10
11 public final class InputFinalClass2
12 {
13 private InputFinalClass2() {}
14 }
15
16 enum testenum1
17 {
18 A, B;
19 testenum1() {}
20 }
21
22 enum testenum2
23 {
24 A, B;
25
26 public static class someinnerClass
27 {
28 private someinnerClass() {}
29 }
30 }
31
32 interface TestInterface {
33 class SomeClass {
34 private SomeClass() {}
35 }
36 }
37
38 @interface SomeAnnotation {
39 class SomeClass {
40 private SomeClass() {}
41 }
42 }
43
44 class TestAnonymousInnerClasses {
45 public static final TestAnonymousInnerClasses ONE = new TestAnonymousInnerClasses() {
46 @Override
47 public int value() {
48 return 1;
49 }
50 };
51
52 private TestAnonymousInnerClasses() {
53 }
54
55 public int value() {
56 return 0;
57 }
58 }
59
60 class TestNewKeyword {
61
62 private TestNewKeyword(String s) {
63 String a = "hello" + s;
64 }
65
66 public int count() {
67 return 1;
68 }
69 public static final TestNewKeyword ONE = new TestNewKeyword("world");
70 public static final test6 TWO = new test6() {
71 };
72
73 public static void main(String[] args) {
74 ArrayList<String> foo = new ArrayList<>();
75 foo.add("world");
76 foo.forEach(TestNewKeyword::new);
77 }
78 }
79
80 interface TestNewKeywordInsideInterface {
81 ArrayList<String> foo = new ArrayList<>();
82 }
83
84
85 abstract class TestPrivateCtorInAbstractClasses {
86 private TestPrivateCtorInAbstractClasses() {
87 }
88 }
89
90 class TestAnonymousInnerClassInsideNestedClass {
91 private TestAnonymousInnerClassInsideNestedClass() { }
92
93 static class NestedClass {
94
95 public final static TestAnonymousInnerClassInsideNestedClass ONE
96 = new TestAnonymousInnerClassInsideNestedClass() {
97 };
98
99 private NestedClass() {}
100 }
101 static class NestedClass2 {
102
103 private NestedClass2() {}
104
105 public static final test6 ONE = new test6() {
106
107 public final NestedClass2 ONE = new NestedClass2() {
108
109 };
110 };
111 }
112 }
113