mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ensure enum constructors are private (IDEA-139065)
This commit is contained in:
@@ -136,6 +136,11 @@ public class PsiModifierListImpl extends JavaStubPsiElement<PsiModifierListStub>
|
||||
node.findChildByType(JavaTokenType.PRIVATE_KEYWORD) == null;
|
||||
}
|
||||
}
|
||||
else if (aClass != null && aClass.isEnum() && ((PsiMethod)parent).isConstructor()) {
|
||||
if (type == JavaTokenType.PRIVATE_KEYWORD) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (parent instanceof PsiField) {
|
||||
if (parent instanceof PsiEnumConstant) {
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ enum Operation {
|
||||
<error descr="'valueOf(String)' is already defined in 'Operation'">void valueOf(String s)</error> {}
|
||||
}
|
||||
|
||||
class exte extends <error descr="Cannot inherit from final 'Operation'">Operation</error> {
|
||||
<error descr="There is no default constructor available in 'Operation'">class exte extends <error descr="Cannot inherit from final 'Operation'">Operation</error></error> {
|
||||
}
|
||||
|
||||
class use {
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ enum Operation {
|
||||
<error descr="'valueOf(String)' is already defined in 'Operation'">void valueOf(String s)</error> {}
|
||||
}
|
||||
|
||||
class exte extends <error descr="Cannot inherit from final 'Operation'">Operation</error> {
|
||||
<error descr="There is no default constructor available in 'Operation'">class exte extends <error descr="Cannot inherit from final 'Operation'">Operation</error></error> {
|
||||
}
|
||||
|
||||
class use {
|
||||
|
||||
Reference in New Issue
Block a user