Merge branch 'pr-1213'
This commit is contained in:
@ -21,6 +21,9 @@ This is a minor release.
|
||||
|
||||
### Fixed Issues
|
||||
|
||||
* java-codestyle
|
||||
* [#1211](https://github.com/pmd/pmd/issues/1211): \[java] CommentDefaultAccessModifier false positive with nested interfaces (regression from 6.4.0)
|
||||
|
||||
### API Changes
|
||||
|
||||
### External Contributions
|
||||
|
@ -99,7 +99,7 @@ public class CommentDefaultAccessModifierRule extends AbstractCommentRule {
|
||||
&& decl instanceof ASTConstructorDeclaration;
|
||||
|
||||
// ignore if it's an Interface / Annotation / Enum constructor
|
||||
return (isConcreteClass || !isEnumConstructor)
|
||||
return isConcreteClass && !isEnumConstructor
|
||||
// check if the field/method/nested class has a default access
|
||||
// modifier
|
||||
&& decl.isPackagePrivate()
|
||||
|
@ -206,6 +206,18 @@ public class Foo {
|
||||
@interface Bar {
|
||||
String baz();
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>#1211 [java] CommentDefaultAccessModifier false positive with nested interface</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
public interface A {
|
||||
interface B {
|
||||
default void b() {}
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
Reference in New Issue
Block a user