8000 minor: add missing test case to SuperCloneCheckTest · checkstyle/checkstyle@dfed794 · GitHub
[go: up one dir, main page]

Skip to content

Commit dfed794

Browse files
pbludovrnveach
authored andcommitted
minor: add missing test case to SuperCloneCheckTest
1 parent 24e7bdf commit dfed794

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperCloneCheckTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public void testAnotherInputFile() throws Exception {
6262
final DefaultConfiguration checkConfig =
6363
createModuleConfig(SuperCloneCheck.class);
6464
final String[] expected = {
65+
"43:17: " + getCheckMessage(MSG_KEY, "clone", "super.clone"),
6566
"9:17: " + getCheckMessage(MSG_KEY, "clone", "super.clone"),
6667
};
6768
verify(checkConfig, getPath("InputSuperClonePlainAndSubclasses.java"), expected);

src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/superclone/InputSuperClonePlainAndSubclasses.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface InputSuperClonePlainAndSubclasses {
66
}
77

88
class A {
9-
public Object clone() {
9+
public Object clone() { // violation
1010
return null;
1111
}
1212
}
@@ -37,3 +37,12 @@ public void run() {
3737
};
3838
}
3939
}
40+
41+
class D extends B {
42+
43+
public Object clone() throws CloneNotSupportedException { // violation
44+
super.clone(null, null);
45+
return null;
46+
}
47+
48+
}

0 commit comments

Comments
 (0)
0