Merge branch 'pr-1213'

This commit is contained in:
Juan Martín Sotuyo Dodero
2018-06-26 12:51:37 -03:00
3 changed files with 16 additions and 1 deletions

View File

@ -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

View File

@ -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()

View File

@ -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>