treat enum constructors as private (IDEA-118133)

This commit is contained in:
Anna Kozlova
2013-12-12 17:24:49 +04:00
parent 140b91e13a
commit aa007bbd6d
4 changed files with 19 additions and 0 deletions
@@ -281,6 +281,9 @@ public class RefJavaUtilImpl extends RefJavaUtil{
if (ownerClass.isInterface()) {
result = PsiModifier.PUBLIC;
}
if (ownerClass.isEnum() && result.equals(PsiModifier.PACKAGE_LOCAL)) {
result = PsiModifier.PRIVATE;
}
}
}
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
</problems>
@@ -0,0 +1,6 @@
public enum Foo {
;
Foo() {
}
}
@@ -59,6 +59,12 @@ public class JavaDocInspectionTest extends InspectionTestCase {
doTest();
}
public void testEnumConstructor() throws Exception {
final JavaDocLocalInspection localInspection = new JavaDocLocalInspection();
localInspection.METHOD_OPTIONS.ACCESS_JAVADOC_REQUIRED_FOR = "package";
doTest("javaDocInspection/" + getTestName(true), localInspection);
}
public void testIgnoreDuplicateThrows() throws Exception {
final JavaDocLocalInspection inspection = new JavaDocLocalInspection();
inspection.IGNORE_DUPLICATED_THROWS = true;