01: package com.puppycrawl.tools.checkstyle.coding;
02:
03: public class InputClone {
04: public InputClone() throws CloneNotSupportedException {
05: super .equals(new String());
06: super .clone();
07: }
08:
09: public Object clone() throws CloneNotSupportedException {
10: return super .clone();
11: }
12:
13: public void method() throws CloneNotSupportedException {
14: super .clone();
15: }
16:
17: {
18: super .clone();
19: }
20: }
21:
22: class NoSuperClone {
23: public Object clone() {
24: return null;
25: }
26: }
27:
28: class InnerClone {
29: public Object clone() {
30: class Inner {
31: public Object clone() throws CloneNotSupportedException {
32: return super .clone();
33: }
34: }
35: return null;
36: }
37: }
38:
39: // This could not pass as valid semantically but tests that
40: // type arguments are ignored when checking super calls
41: class CloneWithTypeArguments {
42: public <T> Object clone() {
43: return super .<T> clone();
44: }
45: }
46:
47: class CloneWithTypeArgumentsAndNoSuper {
48: public <T> Object clone() {
49: return null;
50: }
51: }
52:
53: //Check that super keword isn't snagged here
54: class MyClassWithGenericSuperMethod {
55: void someMethod(java.util.List<? super java.util.Map> l) {
56:
57: }
58: }
|