Issue #1290: Coverage has been increased to 100% in AbstractDeclarationCollector.
This commit is contained in:
parent
d877cb15cf
commit
ce4df1ec00
5
pom.xml
5
pom.xml
|
|
@ -1661,11 +1661,6 @@
|
|||
<totalBranchRate>89</totalBranchRate>
|
||||
<totalLineRate>95</totalLineRate>
|
||||
<regexes>
|
||||
<regex>
|
||||
<pattern>.*.checks.AbstractDeclarationCollector</pattern>
|
||||
<branchRate>94</branchRate>
|
||||
<lineRate>100</lineRate>
|
||||
</regex>
|
||||
<regex>
|
||||
<pattern>.*.checks.SuppressWarningsHolder</pattern>
|
||||
<branchRate>86</branchRate>
|
||||
|
|
|
|||
|
|
@ -105,4 +105,13 @@ public class RequireThisCheckTest extends BaseCheckTestSupport {
|
|||
Assert.assertNotNull(check.getDefaultTokens());
|
||||
Assert.assertNotNull(check.getRequiredTokens());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWithAnnonymousClass() throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(RequireThisCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig,
|
||||
getPath("coding" + File.separator + "InputRequireThis3.java"),
|
||||
expected);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package com.puppycrawl.tools.checkstyle.checks.coding;
|
||||
|
||||
public class InputRequireThis3 {
|
||||
interface AnonWithEmpty {
|
||||
public void fooEmpty();
|
||||
}
|
||||
|
||||
void method() {
|
||||
AnonWithEmpty foo = new AnonWithEmpty() {
|
||||
|
||||
public void emptyMethod() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fooEmpty() {
|
||||
int a = doSideEffect();
|
||||
}
|
||||
|
||||
public int doSideEffect() {
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue