1
2
3
4
5
6
7 package com.puppycrawl.tools.checkstyle.checks.coding.noclone;
8
9 public class InputNoClone
10 {
11 public InputNoClone() throws CloneNotSupportedException
12 {
13 super.equals(new String());
14 super.clone();
15 }
16
17 public Object clone() throws CloneNotSupportedException
18 {
19 return super.clone();
20 }
21
22 public void method() throws CloneNotSupportedException
23 {
24 super.clone();
25 }
26
27 {
28 super.clone();
29 }
30 }
31
32 class NoSuperClone
33 {
34 public Object clone()
35 {
36 return null;
37 }
38 }
39
40 class InnerClone
41 {
42 public Object clone()
43 {
44 class Inner
45 {
46
47 public Object clone() throws CloneNotSupportedException
48 {
49 return super.clone();
50 }
51 }
52 return null;
53 }
54 }
55
56
57
58 class CloneWithTypeArguments<T> extends CloneWithTypeArgumentsAndNoSuper<T>
59 {
60
61 public CloneWithTypeArguments<T> clone() throws CloneNotSupportedException
62 {
63 return (CloneWithTypeArguments<T>) super.<T>clone();
64 }
65 }
66
67 class CloneWithTypeArgumentsAndNoSuper<T>
68 {
69 public CloneWithTypeArgumentsAndNoSuper<T> clone()
70 throws CloneNotSupportedException
71 {
72 return null;
73 }
74 }
75
76
77 class MyClassWithGenericSuperMethod
78 {
79 void someMethod(java.util.List<? super java.util.Map<Object, Object>> l)
80 {
81
82 }
83
84
85
86
87
88
89 public static Object clone(Object o) {
90 return null;
91 }
92 }
93
94 class AnotherClass {
95
96
97
98
99
100
101
102 public <T> T clone(T t) {
103 return null;
104 }
105 }
106
107 class NativeTest {
108 public native Object clone();
109 }